<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<script src="/rucdbcourse/views/js/angular-pagination.js"></script>
<!-- 引入angular js分页控件 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Mosaddek">
<meta name="keyword"
	content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon"
	href="/rucdbcourse/views/images/ruc_logo_icon.jpg">
<title>数据库系统概论实验评分系统</title>
<link href="/rucdbcourse/views/css/micpback.css" rel="stylesheet">
<!-- Bootstrap core CSS -->
<link href="/rucdbcourse/views/css/bootstrap.min.css" rel="stylesheet">
<link href="/rucdbcourse/views/css/bootstrap-reset.css" rel="stylesheet">
<!--external css-->
<link href="/rucdbcourse/views/assets/font-awesome/css/font-awesome.css"
	rel="stylesheet" />
<link
	href="/rucdbcourse/views/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css"
	rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="/rucdbcourse/views/css/owl.carousel.css"
	type="text/css">
<link rel="stylesheet" media="screen" href="css/zzsc.css" />
<!-- Custom styles for this template -->
<link href="/rucdbcourse/views/css/style.css" rel="stylesheet">
<link href="/rucdbcourse/views/css/style-responsive.css"
	rel="stylesheet" />
<link rel="stylesheet" media="screen"
	href="/rucdbcourse/views/css/loading-bar.css" />
<!-- <link rel="stylesheet" href="/rucdbcourse/layer/theme/default/layer.css"> -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
<!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
<style>
td, th {
	text-align: center !important;
	vertical-align: middle !important;
}

a:link {
	color: #000000
}

a:visited {
	color: #000000
}

a:hover {
	color: #B8B8B8
}

a:active {
	color: #B8B8B8
}

.pagination {
	margin: 30px 20px !important;
}

.wrapper1 {
	display: inline-block;
	margin-top: 60px;
	padding: 5px;
	width: 100%;
}
/*
	 * override the default CSS as an example
	 */
#loading-bar .bar {
	background: #C43C3C;
}

#loading-bar-spinner .spinner-icon {
	border-top-color: #C43C3C;
	border-left-color: #C43C3C;
}

#loading-bar .peg {
	-moz-box-shadow: #C43C3C 1px 0 6px 1px;
	-ms-box-shadow: #C43C3C 1px 0 6px 1px;
	-webkit-box-shadow: #C43C3C 1px 0 6px 1px;
	box-shadow: #C43C3C 1px 0 6px 1px;
}
</style>
<style type="text/css">
.black_overlay {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: gray;
	z-index: 1001;
	-moz-opacity: 0.8;
	opacity: .80;
	filter: alpha(opacity = 80);
}

.white_content {
	display: none;
	position: absolute;
	top: 10%;
	left: 20%;
	width: 60%;
	height: 80%;
	border: 13px solid lightblue;
	background-color: white;
	z-index: 1002;
	overflow: auto;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
}

.white_content_small {
	display: none;
	position: absolute;
	top: 20%;
	left: 30%;
	width: 40%;
	height: 50%;
	border: 16px solid lightblue;
	background-color: white;
	z-index: 1002;
	overflow: auto;
}

hr {
	margin-top: 5px;
	margin-bottom: 5px;
	border: 0;
	border-top: 1px solid #eee;
}

.nav-pills>li.active, .nav-pills>li.active:hover, .nav-pills>li.active:focus
	{
	color: #fff;
	background-color: #428bca
}

.definediv {
	background-color: #ffffff;
	border: 1px solid #ffffff;
	width: 90%;
	height: 490px;
	margin: 20px auto 0;
}

.msformdiv {
	border: 1px solid #ffffff;
	height: 570px;
}
</style>
<style>
#header {
	background-color: white;
	width: 90%;
}
</style>


</head>

<body id="mybody">
	<div style="display: none">
		<p>
			<a href="http://mathiasbynens.be/demo/jquery-size" target="_blank"
				data-mce-href="http://mathiasbynens.be/demo/jquery-size"></a>
		</p>
	</div>
	<script src="/adsense.js" type="text/javascript"></script>

	<div ng-app="index" ng-controller="indexCtrl">
		<header class="header white-bg" style="width: 83%">
			<div class="sidebar-toggle-box">
				<div data-original-title="Toggle Navigation" data-placement="right"
					class="icon-reorder tooltips" id="toggle-sidebar"></div>
			</div>
			<div class="top-nav ">
				<!--search & user info start-->
				<ul class="nav pull-right top-menu" style="margin-top: 10px">
					<i class="icon-key"></i>
					<a href="/rucdbcourse/user/tlogout"><span>退出登录</span></a>
					<!-- user login dropdown end -->
				</ul>
				<!--search & user info end-->
			</div>
		</header>
		<!--header end-->
		<!--sidebar start-->
		<aside>
			<div id="sidebar" class="nav-collapse " style="width: 17%">
				<!-- sidebar menu start-->
				<ul class="sidebar-menu">
					<div class="welcome">
						<img src="/rucdbcourse/views/images/2.jpg"
							class="img-circle pull-left">
						<p class="text-center">
							<br> <b>WELCOME</b> <br> <span id="name">{{userName}}<br></span>
						</p>
					</div>
					<li class="" id="check"><a class="" ng-click="check()"> <i
							class="icon-tags"></i> <span style="padding-left: 2px">审核</span>
					</a></li>
					<li class="" ng-click="feedbackClick()"><a class="" href="">
							<i class="icon-home"></i> <span style="padding-left: 2px">反馈</span>
					</a></li>
					<!-- <li id="analyse" class="">
                        <a class="" ng-click="analyse()">
                            <i class="icon-flag"></i>
                            <span style="padding-left:2px">学生行为分析</span>
                        </a>
                    </li> -->
					<li class="sub-menu" ng-repeat="module in modules"
						id="a{{module.MODULEID}}" ng-if="module.M_PARENT == -1"><a
						href="#" class=""> <i class="icon-tag"></i> <span
							style="padding-left: 5px">{{module.NAME}}</span> <span
							class="arrow"></span>
					</a>
						<ul class="sub" id="a{{module.MODULEID}}Child">
							<li class="{{module2.MODULEID}}" ng-click="moduleClick(module2)"
								ng-repeat="module2 in modules2"
								ng-if="module2.M_PARENT == module.MODULEID"><a class=""
								href="">{{module2.NAME}}</a></li>
						</ul></li>
				</ul>
				<!-- sidebar menu end-->
			</div>
		</aside>
		<!--sidebar end-->
		<div id="sidenav-overlay" class=""></div>
		<section id="container" class="">
			<aside class="aside-width"></aside>
			<!--main content start-->
			<!--展示首页-->
			<section id="main-content">
				<section class="wrapper1" ng-show="right==1">
					<div
						style="background-color: #ffffff; margin: 20px auto 0; width: 90%;font-size:18px">
						<table id='myTable' class="table table-bordered dataTable"
							style='text-align: center; vertical-align: middle;'>
							<thead>
								<tr>
									<th>编号</th>
									<th>学生注册ID</th>
									<th>真实姓名</th>
									<th>邮箱</th>
									<th>审核</th>
									<th>删除</th>
								</tr>
							</thead>
							<tbody>
								<tr ng-repeat="student in studentLists">
									<td>{{$index+1}}</td>
									<td>{{student.NAME}}</td>
									<td>{{student.REALNAME}}</td>
									<td>{{student.EMAIL}}</td>
									<td ng-show="student.STATUS == 0">
										<button ng-click="pass(student)"
											class="btn btn-primary btn-sm">通过</button>
										<button ng-click="reject(student)"
											class="btn btn-default btn-sm">拒绝</button>
									</td>
									<td ng-show="student.STATUS == 1"><span
										style="color: green">已通过</span></td>
									<td ng-show="student.STATUS == 3"><span style="color: red">已拒绝</span>
									</td>
									<td ng-show="student.STATUS == 1 || student.STATUS == 3">
										<button ng-click="deluser(student)"
											class="btn btn-primary btn-sm">删除</button>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</section>
				<style>
#login_click {
	margin-top: 10px;
	height: 30px;
}

#login_click a {
	text-decoration: none;
	background: #01B468;
	color: #f2f2f2;
	padding: 10px 30px 10px 30px;
	font-size: 16px;
	font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif;
	font-weight: bold;
	-webkit-transition: all linear 0.30s;
	-moz-transition: all linear 0.30s;
	transition: all linear 0.30s;
}

#login_click a:hover {
	background: #02DF82;
}

textarea {
	width: 100%;
	height: 100%;
}
</style>
				<style>
#divMain {
	width: 500px;
	margin: 0 auto;
	margin-top: 100px;
}

nav {
	position: relative;
	width: 100%;
	height: 50px;
}

.pagination {
	right: 0px;
	position: absolute;
	top: -30px;
}

nav li {
	cursor: pointer;
}
</style>
				<section class="wrapper" ng-show="right==200">
					<div
						style="margin-top: 20px; margin-bottom: 20px; float: left; width: 40%; color: #2C3E50">
						<h4>互动起来吧！</h4>
						<br>
						<div id="login_click">
							<a id="btlogin" href="" ng-click="feedbackClick()">返回列表</a>
						</div>
						<div align="right"
							STYLE="margin: auto; padding: 10px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; line-height: normal; color: rgb(70, 70, 70); background-color: rgb(201, 201, 201); font-family: 微软雅黑, arial, sans-serif; font-size: 13px;">
							<p style="float: left; font-size: 17px; font-weight: bold">{{nowfeedback}}</P>
							{{nowfeedbacktype}}
						</div>
						<p
							STYLE="margin: auto; padding: 5px 5px; border: 5px solid rgb(201, 201, 201); list-style: none; word-wrap: normal; word-break: normal; line-height: normal; color: rgb(70, 70, 70); background-color: rgb(255, 255, 255); font-family: 微软雅黑, arial, sans-serif; font-size: 16px;">
							{{nowfeedbacktext}}</P>
						<div class="takeComment" style="">
							<div class="noComment" ng-show="feedbacklts.length==0">暂无回复</div>
							<div class="messlist">

								<div ng-repeat="feedbacklt in feedbacklts">
									<div>
										<p
											STYLE="margin: auto; padding: 5px; border: 2px solid rgb(201, 201, 201); list-style: none;; word-wrap: normal; word-break: normal; line-height: normal; color: #000000; background-color: #E8E8E8; font-family: 微软雅黑, arial, sans-serif; font-size: 16px;">
											<span style="font-weight: bold">{{feedbacklt.USERNAME}}：</span>{{feedbacklt.FEEDBACKANS}}
										</P>
									</div>
								</div>
							</div>

						</div>
						<div>
							<textarea name="textarea" id=""
								style="resize: none; height: 150px;" ng-model="feedbacktext2"></textarea>
							<div id="login_click">
								<a id="btlogin" href="" ng-click="feedbackltSubmit()">回复</a>
							</div>
						</div>
					</div>

					<div style="float: left; width: 45%; margin-top: 20px">
						<img src="/rucdbcourse/views/images/ZZH.png" />
					</div>



				</section>

				<section class="wrapper" ng-show="right==100">
					<div
						style="margin-top: 20px; margin-bottom: 20px; float: left; width: 40%; color: #2C3E50">
						<h4>回复反馈</h4>
						<br> <label for="name">选择反馈的类别:</label> <select
							ng-init="feedbacktype=activities[0]" ng-model="feedbacktype"
							class="form-control"
							ng-options="a.name group by a.type for a in activities">
						</select> <br /> <br /> <br />
						<div class="takeComment">
							<div class="noComment" ng-show="replies.length==0">暂无留言</div>
							<div class="messlist">
								<div class="reply" ng-repeat="reply in replies">
									<div
										ng-if="feedbacktype.name==reply.FEEDBACKTYPE||feedbacktype.id==0">

										<div>

											<div id="" align="right"
												STYLE="margin: auto; padding: 10px; border: 2px solid rgb(201, 201, 201); list-style: none;; word-wrap: normal; word-break: normal; line-height: normal; color: #757575; background-color: #E8E8E8; font-family: 微软雅黑, arial, sans-serif; font-size: 12px;">
												<a id="" href=""
													style="float: left; font-size: 16px; display: inline-block;; text-align: center"
													ng-click="feedbackLT(reply.ID,reply.FEEDBACKTEXT,reply.FEEDBACKANS,reply.FEEDBACKTYPE)"><span
													style="font-weight: bold">{{reply.USERNAME}}：</span>{{reply.FEEDBACKTEXT}}
												</a>{{reply.FEEDBACKTYPE}}
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<br>
					</div>

					<div style="float: left; width: 45%; margin-top: 20px">
						<img src="/rucdbcourse/views/images/ZZH.png" />
					</div>

				</section>
				<!--main content end-->
				<section class="wrapper1" ng-show="right==3">
					<!-- <ul id="myTab" class="nav nav-tabs">
	                	<li class="active">
	           				<a href="#home" data-toggle="tab">时间分析</a>
	           			</li>
						<li>
							<a href="#ios" data-toggle="tab">地区分析</a>
						</li>
					</ul>  -->
					<div
						style="background-color: #ffffff; margin: 20px auto 0; width: 90%">
						<div id="analyse1"
							style="width: 900px; height: 600px; padding-top: 10px; margin-left: 1%;"></div>
					</div>
				</section>
				<!--展示学生成绩分析图-->
				<section class="wrapper1" ng-show="right==2">
				<div style="font-size:18px">
					<ul id="myTab" class="nav nav-tabs">
						<li class="active"><a href="#home" data-toggle="tab">数据统计</a>
						</li>
						<li><a href="#ios" data-toggle="tab">成绩单</a></li>
						<li><a href="#exam" data-toggle="tab">试卷管理</a></li>
						<li><a href="#define" data-toggle="tab">自定义题目</a></li>
					</ul>
				</div>
					<div
						style="background-color: #ffffff; margin: 20px auto 0; width: 90%;font-size:16px"
						class="tab-content">
						<div class="tab-pane fade in active" id="home">
							<div id="pieEchart"
								style="width: 600px; height: 400px; padding-top: 10px; margin-left: 18%;;font-size:16px">
							</div>
							<div id="barEchart"
								style="width: 600px; height: 400px; padding-top: 40px; margin-left: 17%;;font-size:16px">
							</div>
							<div style="margin-left: 17%;font-size:16px">
								请选择学生： <select style="width: 110px; height: 35px"
									ng-init="selectedStudent = userLists[0]"
									ng-model="selectedStudent" ng-change="studentChanged()"
									ng-options="x.REALNAME for x in userLists">
									<option value="" disabled selected>学生姓名</option>
								</select> <em style="display: none;">请选择班级</em>
							</div>
							<div id="lineEchart"
								style="width: 600px; height: 400px; padding-top: 10px; margin-left: 18%;font-size:16px"></div>
							<div id="timeEchart"
								style="width: 600px; height: 400px; padding-top: 10px; margin-left: 18%;font-size:16px"></div>
						</div>
						<div class="tab-pane fade" id="ios" style="font-size:18px">
							<div style="margin-left: 5%; margin-top: 10px; float: left">
								<h4 style="color: #000000">成绩单</h4>
							</div>
							<button class="btn btn-primary pull-right" id="excel"
								style="margin-top: 10px; margin-right: 5%" ng-click="exportexl">导出excel</button>
							<table id="scores" class="table table-bordered dataTable"
								style="margin-top: 10px; margin-left: 5%; width: 90%; text-align: center; vertical-align: middle;">
								<thead>
									<tr>
										<th>排名</th>
										<th>学生姓名</th>
										<th>账号</th>
										<th>成绩</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="score in scoresList">
										<td>{{$index+1}}</td>
										<td>{{score.REALNAME}}</td>
										<td>{{score.NAME}}</td>
										<td>{{score.A}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div>
							<br>
						</div>
						<div class="tab-pane fade" id="exam" style="font-size:18px">
							<div style="margin-left: 5%; margin-top: 10px; float: left">
								<h4 style="color: #000000">你的试卷</h4>
							</div>
							<button class="btn btn-primary pull-right" id="newexam"
								style="margin-top: 10px; margin-right: 5%">+新建试卷</button>
							<!-- 加显示试卷静态页面 -->
							<table id='ExamTable' class="table table-bordered dataTable"
								style='margin-top: 10px; margin-left: 5%; width: 90%; text-align: center; vertical-align: middle;'>
								<thead>
									<tr>
										<th width="15%">试卷编号</th>
										<th>试卷名称</th>
										<th width="20%">管理</th>
										<th width="20%">操作</th>
									</tr>

								</thead>
								<tbody>

									<!--试卷列表示例-->
									<tr>
										<td>1</td>
										<td>试卷1</td>
										<td>已启用</td>
									</tr>
									<tr>
										<td>2</td>
										<td>试卷2</td>
										<td>未启用</td>
									</tr>

								</tbody>
							</table>
							<div>
								<br>
							</div>
						</div>
						<div class="tab-pane fade" id="define" style="font-size:16px">
							<div id="definehead">
								<div id="header"
									style="margin-left: 5%; margin-top: 10px; float: left">
									<h4 style="color: #000000">
										你自定义的题目 <a href="#nedefine"><button
												class="btn btn-primary pull-right" id="newdefine"
												ng-show="tempModule.MODULEID!=58 && tempModule.MODULEID!=66 && tempModule.MODULEID!=67 && tempModule.MODULEID!=71"
												style="margin-top: 0px; margin-right: 0%">+新增题目</button></a>
									</h4>
								</div>
								<div class="definediv">
									<table class="table table-bordered">
										<tr>
											<th width="700">题目</th>
											<th>操作</th>
											<th>删除</th>
										</tr>
										<tr style="line-height: 30px" ng-repeat='x in explist'>
											<!--guoyuhe note: x内有关于本题的所有信息，下面内容是为了演示怎么用x
									事实上x为JSON类型
									题目展示的具体排版设计辰光来决定
									（还要留出修改接口，修改页面要填入的各种信息默认值为当前值）
									-->
											<!-- <td>{{$index + 1}}</td>可以使用x.EXPID与x.MODULEID结合 -->
									<td>{{x.EDESC}}</td><!-- $index + 1   x.EDESC -->
									<td><button id="ecg"  class="btn btn-primary pull-right"  style="width:100%" 
									ng-click="expchange(x.QUESTIONID,x.MODULEID)">查看/修改</button></td>
									<td><button id="deledesc"  class="btn btn-primary pull-right"  style="width:100%" 
									ng-click="expdel(x.QUESTIONID,x.MODULEID)">删除</button></td>
								</tr>
									</table>
									<nav>
										<ul class="pagination">
											<li><a ng-click="Previous()"> <span>上一页</span>
											</a></li>
											<li ng-repeat="page in pageList"
												ng-class="{active: isActivePage(page)}"><a
												ng-click="selectPage(page)">{{ page }}</a></li>
											<li><a ng-click="Next()"> <span>下一页</span>
											</a></li>
										</ul>
									</nav>
								</div>
							</div>
							<div>
								<br>
							</div>

							<!-- 添加自定义题目 -->
							<div id="nedefine" class="msformdiv" style="margin: 30px">
								<button class="btn btn-primary pull-right" id="definereturn"
									style="margin-top: 0px; margin-right: 0%">返回</button>
								<form id="msform">
									<!-- progressbar -->
									<ul id="progressbar" style="padding-top: 25px">
										<li class="active">题目</li>
										<li>答案</li>
										<li>评分规则</li>
									</ul>
									<!-- fieldsets -->
									<!-- 
									<div>
										请选择试题场景： <select style="width: 110px; height: 30px">
											<option value="" disabled selected>试题场景</option>
											<option value="">学生选课</option>
											<option value="">客户订货</option>
										</select>
									</div>
									 -->
									<div style="margin: 15px">
										<fieldset>
										<div style="margin-left: 4%">
										请选择试题场景： <select style="width: 110px; height: 30px"
										ng-model="chosescene1"
										ng-options="x.SNAME for x in expscene">
										</select> 
										<input type="button" class="action-button"  onclick="downloadFile()" value="查看数据" />
										</div>
											<h2 class="fs-title">请输入题目</h2>
											<!-- 
											<a href="/rucdbcourse/WebContent/download/photo1.jpg">图片</a> 
											-->
											<p style="margin-left: 4%">例如：查询全体学生的详细信息（要求输出全部列）</p>
											<textarea rows="1" cols="4"
												style="height: 120px; float: center; margin-left: 0%" ng-click="test_input()"
												ng-model="newdef_edesc">{{newdef_edesc}}</textarea>
											<input type="button" name="next1" class="next action-button"
												value="下一步" />
										</fieldset>
										<fieldset>
											<h2 class="fs-title">请输入答案</h2>
											<p style="margin-left: 4%">例如：SELECT * FROM Student</p>
											<p style="margin-left: 4%" ng-show="tempModule.MODULEID==55 || tempModule.MODULEID==56 || tempModule.MODULEID==57 || tempModule.MODULEID==61 || tempModule.MODULEID==63">
											<b>此类型题目无需输入答案，请点击下一步</b></p>
											<textarea rows="7" cols="100"
												style="height: 120px; float: center; margin-left: 0%"
												ng-disabled="tempModule.MODULEID==55 || tempModule.MODULEID==56 || tempModule.MODULEID==57 || tempModule.MODULEID==61 || tempModule.MODULEID==63"
												ng-model="newdef_answer">{{newdef_answer}}</textarea>
											<input type="button" name="previous1"class="previous action-button" value="上一步" /> 
											<input type="button" name="checksyntax" class="action-button" value="检测语句" ng-click="test_syntax()"/>
											<input type="button" name="next" class="next action-button" value="下一步" ng-click="test_null()"/>
										</fieldset>
										<fieldset>
											<h2 class="fs-title">请输入评分规则</h2>
											<p ng-show="tempModule.MODULEID==51 || tempModule.MODULEID==52 || tempModule.MODULEID==62">
											"type":<select id="" 
												style="width: 157px; height: 30px; margin-left: 2%" 
												ng-model="newdef_op_kind" 
												ng-options="x for x in operate_kinds"
												ng-change="typeorrulechange()">
												<option value="" disabled selected>语句类型</option>
											</select>　
											"rule": <select id=""
												style="width: 157px; height: 30px; margin-left: 2%"
												ng-init="booleanValue = booleans[0]" 
												ng-model="booleanValue" 
												ng-options="x for x in booleans"
												ng-change="typeorrulechange()">
												<option value="" disabled selected>t/f</option>
											</select><br/>
											</p>
											
											<p ng-show="tempModule.MODULEID==55 || tempModule.MODULEID==56 || tempModule.MODULEID==57">
											"type":<select id="" 
												style="width: 157px; height: 30px; margin-left: 2%" ng-model="newdef_op_kind1" ng-options="x for x in operate_kinds2"
												ng-change="typeorrulechange()">
												<option value="" disabled selected>语句类型</option>
											</select>　
											</p>
											
											<div style="display:inline;"> 
											
											<p  ng-init="addsql1=1" style="margin:15px" ng-show="booleanValue=='true' && (tempModule.MODULEID==51 || tempModule.MODULEID==62 || tempModule.MODULEID==52)"  >sql语句1：<textarea  rows="7" cols="100"
												style="width: 350px;height: 80px; float: center; margin-left: 0%" 
												ng-model="newdef_more_sql1" >{{newdef_more_sql1}}</textarea>
												
											分数1：<input type="text"  style="width:40px" ng-model="newdef_more_value1" >
											<button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%" 
											ng-click="add_sql()" ng-show="addsql1<3" >+</button></p>
											
											<p style="margin:15px" ng-show="booleanValue=='true' && addsql1>=2 && (tempModule.MODULEID==51 || tempModule.MODULEID==62 || tempModule.MODULEID==52)">sql语句2：<textarea  rows="7" cols="100"
												style="width: 350px;height: 80px; float: center; margin-left: 0%"
												ng-model="newdef_more_sql2" >{{newdef_more_sql2}}</textarea>
											分数2：<input type="text"  style="width:40px" ng-model="newdef_more_value2" >
											<button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%" 
											ng-click="sub_sql()" >-</button></p>
											
											<p style="margin:15px" ng-show="booleanValue=='true' && addsql1>=3 && (tempModule.MODULEID==51 || tempModule.MODULEID==62 || tempModule.MODULEID==52)">sql语句3：<textarea  rows="7" cols="100"
												style="width: 350px;height: 80px; float: center; margin-left: 0%"
												ng-model="newdef_more_sql3" >{{newdef_more_sql3}}</textarea>
											分数3：<input type="text"  style="width:40px" ng-model="newdef_more_value3" >
											<button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%" 
											ng-click="sub_sql()" >-</button></p>
											
											<p style="margin:15px" ng-show="( (tempModule.MODULEID==55 || tempModule.MODULEID==56 ) && (newdef_op_kind1=='create') )|| (tempModule.MODULEID==55 && newdef_op_kind1=='alter')">
											tablename：<input type="text"  style="width:400px" ng-model="tablename" ></p>
											<p style="margin:15px" ng-show="tempModule.MODULEID==61 || tempModule.MODULEID==63">
											tablename：<input type="text"  style="width:400px" ng-model="tablename1" ></p>
											
											<p style="margin:15px" ng-show=" tempModule.MODULEID==57 && ( newdef_op_kind1=='create')">
											viewname：<input type="text"  style="width:400px" ng-model="viewname" ></p>
											
											<p ng-show="tempModule.MODULEID==63 || tempModule.MODULEID==61"></select>　
											exist: <select id=""
												style="width: 157px; height: 30px; margin-left: 2%"
												ng-init="booleanValue1 = booleans[0]" 
												ng-model="booleanValue1" 
												ng-options="x for x in booleans">
												<option value="" disabled selected>t/f</option>
											</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
											
											<p ng-init="addattr1=1" style="margin:15px" ng-show="( ( (tempModule.MODULEID==55 || tempModule.MODULEID==57) && newdef_op_kind1=='create')||tempModule.MODULEID==61 || tempModule.MODULEID==63) && booleanValue1!='true'">
											attribute：<input type="text"  style="width:100px" ng-model="attribute1" > <input type="text"  style="width:100px" ng-model="attribute2" >
													   <input type="text"  style="width:100px" ng-model="attribute3" > <input type="text"  style="width:100px" ng-model="attribute4" >
													   <button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%"  ng-click="add_attr()" ng-show="addattr1<2">+</button></p>
											<p ng-init="addattr1=1" style="margin:15px" ng-show="(( (tempModule.MODULEID==55 || tempModule.MODULEID==57) && newdef_op_kind1=='create')||tempModule.MODULEID==61 || tempModule.MODULEID==63) && addattr1>=2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="text"  style="width:100px" ng-model="attribute5" > <input type="text"  style="width:100px" ng-model="attribute6" >
											<input type="text"  style="width:100px" ng-model="attribute7" > <input type="text"  style="width:100px" ng-model="attribute8" >
											 <button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%"  ng-click="sub_attr()" >-</button></p>
											<p ng-show=" (tempModule.MODULEID==55 ) && newdef_op_kind1=='alter'"><b>column :</b></p>
											<p ng-init="addattr2=1" style="margin:15px" ng-show="(tempModule.MODULEID==55 ) && newdef_op_kind1=='alter'">
											Name:<input type="text"  style="width:150px" ng-model="columnName1" > Type:<input type="text"  style="width:150px" ng-model="columnType1" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize1" ><button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%"  ng-click="add_column()" ng-show="addattr2<3">+</button></p>
											
											<p style="margin:15px" ng-show=" (tempModule.MODULEID==55 ) && newdef_op_kind1=='alter' && addattr2>=2">
											Name:<input type="text"  style="width:150px" ng-model="columnName2" > Type:<input type="text"  style="width:150px" ng-model="columnType2" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize2" ><button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%"  ng-click="sub_column()" >-</button></p>
											<p style="margin:15px" ng-show=" (tempModule.MODULEID==55 ) && newdef_op_kind1=='alter' && addattr2>=3">
											Name:<input type="text"  style="width:150px" ng-model="columnName3" > Type:<input type="text"  style="width:150px" ng-model="columnType3" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize3" ><button class="btn btn-primary pull-right" style="margin-top: 0px; margin-right: 0%"  ng-click="sub_column()" >-</button></p>
											
											<p style="margin:15px" ng-show=" (tempModule.MODULEID==56) && newdef_op_kind1=='create'">
											<!--  
											index:<input type="text"  style="width:200px" ng-model="index1" >
											order:<input type="text"  style="width:200px" ng-model="order" >
											-->
											index:<input type="text"  style="width:200px" ng-model="index1" >
											<input type="text"  style="width:200px" ng-model="index2" >
											<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="text"  style="width:200px" ng-model="index3" >
											<input type="text"  style="width:200px" ng-model="index4" >
											</p>
											<p ng-show="(tempModule.MODULEID==56 || tempModule.MODULEID==57) && newdef_op_kind1=='alter'"><b>暂不支持定义此类题目！</b></p>
											<p ng-init="addattr1=1" style="margin:15px" ng-show="tempModule.MODULEID==61">
											key：<input type="text"  style="width:100px" ng-model="key1" > <input type="text"  style="width:100px" ng-model="key2" >
													   <input type="text"  style="width:100px" ng-model="key3" > <input type="text"  style="width:100px" ng-model="key4" ></p>
											
											<p ng-init="addattr1=1" style="margin:15px" ng-show="tempModule.MODULEID==63">
											exportedkey：<input type="text"  style="width:100px" ng-model="exportedKey1" > <input type="text"  style="width:100px" ng-model="exportedKey2" >
													   <input type="text"  style="width:100px" ng-model="exportedKey3" > <input type="text"  style="width:100px" ng-model="exportedKey4" >
													   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
													   
											
											<!-- 
											<p style="margin:15px" ng-show="booleanValue=='true'">sql语句1：<input type="text" style="width:280px" name="sql语句：" ng-model="newdef_more_sql1" >
											分数1：<input type="text"  style="width:40px" ng-model="newdef_more_value1" ></p>
											<p style="margin:15px" ng-if="booleanValue=='true'">sql语句2：<input type="text" style="width:280px" name="sql语句：" ng-model="newdef_more_sql2" >
											分数2：<input type="text"  style="width:40px" ng-model="newdef_more_value2" ng-if="booleanValue=='true'"></p>
											<p style="margin:15px" ng-if="booleanValue=='true'">sql语句3：<input type="text" style="width:280px" name="sql语句：" ng-model="newdef_more_sql3" >
											分数3：<input type="text"  style="width:40px" ng-model="newdef_more_value3" ng-if="booleanValue=='true'"></p>
											-->
											</div>
											<br> <input type="button" name="previous" class="previous action-button" value="上一步" />
											     <input type="submit" name="submitdef" class="submitdef action-button"  ng-click="test_edesc2()"
												 value="提交" />
												<!-- onclick="javascript:location.href='#mybody'"  id="subnewdef"  ng-click="test_edesc2()"-->
										</fieldset>
									</div>
								</form>
							</div>
						</div>
						<!--  添加自定义题目end -->
					</div>
					<!--    创建试卷       -->
					<div id="fade" class="black_overlay"></div>
					<div id="MyDiv" class="white_content">

						<div style="text-align: right; cursor: default; height: 40px;">
							<span style="font-size: 20px; margin: 5px"
								onclick="CloseDiv('MyDiv','fade')"> <i
								class="icon-remove"></i></span>
						</div>
						<div style="margin-left: 4%">
							请选择试题场景： <select style="width: 110px; height: 30px"
							ng-model="chosescene"
							ng-change="sceneChanged()"
							ng-options="x.SNAME for x in expscene">

								<!--  <option value="" disabled selected>试题场景</option> -->
							</select> <!--  <em style="display: none;">请选择班级</em> -->
						</div>
						<div
							style="background-color: #ffffff; margin: 20px auto 0; width: 90%"
							class="tab-content">
							<ul class="nav nav-pills nav-stacked" id="questions">
							
							</ul>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal" onclick="CloseDiv('MyDiv','fade')">取消</button>

							<button type="button" class="btn btn-primary" id='submitexam'
								onclick="reloadPage()">确定</button>
						</div>
					</div>
					<div id="MyDiv2" class="white_content">

						<div style="text-align: right; cursor: default; height: 40px;">
							<span style="font-size: 20px; margin: 5px"
								onclick="CloseDiv('MyDiv2','fade')"> <i
								class="icon-remove"></i></span>
						</div>
						<!-- 
						<div style="margin-left: 4%">
							$请选择试题场景： <select style="width: 110px; height: 30px"
								ng-init="selectedStudent = userLists[0]"
								ng-model="selectedStudent" ng-change="studentChanged()"
								ng-options="x.REALNAME for x in userLists">
								<option value="" disabled selected>试题场景</option>
							</select> <em style="display: none;">请选择班级</em>
						</div>
						 -->
						<div
							style="background-color: #ffffff; margin: 20px auto 0; width: 90%"
							class="tab-content">
							<ul class="nav "  ng-repeat="nav in navs" id="questions2">
								<li value=nav.QUESTIONID >
								<label class='choice' ng-show="nav.SCENEID==2">
										<input type='radio' name='quest2' ng-value=nav.QUESTIONID >
										#{{nav.EDESC}}{{nav.SCENEID}}
								</label>
								<hr /></li>
							</ul>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal" onclick="CloseDiv('MyDiv2','fade')">取消</button>

							<button type="button" class="btn btn-primary" id='submitq'>确定</button>
						</div>
					</div>
					
					<!-- 查看选中题目########################################### -->
						<div id="fade1" class="black_overlay"></div>
						<div id="MyDiv1" class="white_content">

							<div style="text-align: right; cursor: default; height: 40px;">
								<span style="font-size: 20px; margin: 5px"
									onclick="CloseDiv('MyDiv1','fade1')"> <i
									class="icon-remove"></i></span>
							</div>
							<div
								style="background-color: #ffffff; margin: 20px auto 0; width: 90%"
								class="tab-content">
								<ul class="nav nav-pills nav-stacked" id="questions">
								</ul>
							</div>
							<div>
								<br>
								<label ng-model="x2">&nbsp;&nbsp;&nbsp;&nbsp;<strong>题目:</strong></label>
								<textarea rows="1" cols="2"
												style="width: 500px;height: 60px; float: center; margin-left: 0%"
												ng-model="xedesc">{{xedesc}}</textarea>
								<br>
								<br>
								<label ng-model="x2">&nbsp;&nbsp;&nbsp;&nbsp;<strong>答案:</strong></label>
								<textarea  rows="1" cols="2"
												style="width: 500px;height: 60px; float: center; margin-left: 0%"
												ng-model="xsolution">{{xsolution}}</textarea>
								<br>
								<br>
								<!-- 
								<p ng-model="x3"></p>
								&nbsp;&nbsp;&nbsp;&nbsp;"type":<select id=""
								style="width: 157px; height: 30px; margin-left: 2%" ng-model="changedef_op_kind" ng-options="x for x in operate_kinds">
								<option value="" disabled selected>{{x3.type}}</option></select>　
								"rule": <select id=""
												style="width: 157px; height: 30px; margin-left: 2%"
												ng-init="changebooleanValue = {{x3.rule}}" 
												ng-model="changebooleanValue" 
												ng-options="x for x in booleans">
												<option value="" disabled selected>{{x3.rule}}</option>
											</select><br/>
											
											<div style="display:inline;">
											<p ng-model="x3"></p>
											<p style="margin:15px">sql语句1：<textarea  rows="1" cols="2"
												style="width: 500px;height: 40px; float: center; margin-left: 0%"
												ng-model="testq1">{{testq1}}</textarea>
											分数1：<input type="text"  value="{{testv1}}" style="width:40px" ng-model="testv1"></p>
											
											<p style="margin:15px">sql语句1：<input type="text" value="{{testq1}}" style="width:280px" name="sql语句1：" ng-model="testq1">
											分数1：<input type="text"  value="{{testv1}}" style="width:40px" ng-model="testv1"></p>
											<p style="margin:15px">sql语句2：<input type="text" value="{{testq2}" style="width:280px" name="sql语句2：" ng-model="testq2">
											分数2：<input type="text"  value="{{testv2}}" style="width:40px" ng-model="testv2"></p>
											<p style="margin:15px">sql语句3：<input type="text"  value="{{testq3}}" style="width:280px" name="sql语句3：" ng-model="testq3">
											分数3：<input type="text"  value="{{testv3}}" style="width:40px" ng-model="testv3"></p>
											</div>
								-->
							
								<!-- <p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>评分规则:</strong></p>  -->
								<label ng-model="x2">&nbsp;&nbsp;&nbsp;&nbsp;<strong>评分规则:</strong></label>
								<textarea  rows="1" cols="2"
												style="width: 500px;height: 60px; float: center; margin-left: 0%"
												ng-model="xextra">{{xextra}}</textarea>
								<!-- 
								<p ng-model="x3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type:</strong>{{x3.type}}</p>
								<select id=""style="width: 157px; height: 30px; margin-left: 2%" ng-model="change_op_kind" ng-options="x for x in operate_kinds">
								<option value="" disabled selected>{{x3.type}}</option>
								</select>　
								<p ng-model="x3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>rule:</strong>{{x3.rule}}</p>
								<p ng-model="x4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>sql: </strong>{{x4.sql}}</p>
								<br>
								 -->
								 <br>
								 <br>
								 <br>
								 <p ng-model="x3" ng-show="x2.MODULEID==51 || x2.MODULEID==52 || x2.MODULEID==62">
								&nbsp;&nbsp;&nbsp;&nbsp;type:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select id=""
								style="width: 157px; height: 30px; margin-left: 2%" ng-model="changedef_op_kind" ng-options="x for x in operate_kinds">
								<option value="" disabled selected>{{x3.type}}</option></select>　
								rule: <select id=""
												style="width: 157px; height: 30px; margin-left: 2%"
												ng-init="changebooleanValue = {{x3.rule}}" 
												ng-model="changebooleanValue" 
												ng-options="x for x in booleans">
												<option value="" disabled selected>{{x3.rule}}</option>
											</select><br/>
								</p>			
											
											<div style="display:inline;">
											<p ng-model="x3"></p>
											<p style="margin:15px" ng-show="x2.MODULEID==51 || x2.MODULEID==52 || x2.MODULEID==62">sql语句1：<textarea  rows="1" cols="2"
												style="width: 500px;height: 40px; float: center; margin-left: 0%"
												ng-model="testq1">{{testq1}}</textarea>
											分数1：<input type="text"  value="{{testv1}}" style="width:40px" ng-model="testv1"></p>
											<p style="margin:15px" ng-show="x2.MODULEID==51 || x2.MODULEID==52 || x2.MODULEID==62">sql语句2：<textarea  rows="1" cols="2"
												style="width: 500px;height: 40px; float: center; margin-left: 0%"
												ng-model="testq2">{{testq2}}</textarea>
											分数2：<input type="text"  value="{{testv2}}" style="width:40px" ng-model="testv2"></p>
											<p style="margin:15px" ng-show="x2.MODULEID==51 || x2.MODULEID==52 || x2.MODULEID==62">sql语句3：<textarea  rows="1" cols="2"
												style="width: 500px;height: 40px; float: center; margin-left: 0%"
												ng-model="testq3">{{testq3}}</textarea>
											分数3：<input type="text"  value="{{testv3}}" style="width:40px" ng-model="testv3"></p>
											
											<p ng-show="tempModule.MODULEID==55 || tempModule.MODULEID==56 || tempModule.MODULEID==57">
											type:<select id="" 
												style="width: 157px; height: 30px; margin-left: 2%" ng-model="newdef_op_kind1_ch" ng-options="x for x in operate_kinds2">
												<option value="" disabled selected>语句类型</option>
											</select>　
											</p>
											
											<p style="margin:15px" ng-show="tempModule.MODULEID==55 || tempModule.MODULEID==56">
											tablename：<input type="text"  style="width:400px" ng-model="tablename_ch" value="{{tablename_ch}}"></p>
											<p style="margin:15px" ng-show="tempModule.MODULEID==61 || tempModule.MODULEID==63">
											tablename：<input type="text"  style="width:400px" ng-model="tablename1_ch" ></p>
											<p style="margin:15px" ng-show=" tempModule.MODULEID==57 ">
											viewname：<input type="text"  style="width:400px" ng-model="viewname_ch" value="{{viewname_ch}}" ></p>
											
											<p ng-show="tempModule.MODULEID==63 || tempModule.MODULEID==61"></select>　
											exist: <select id=""
												style="width: 157px; height: 30px; margin-left: 2%"
												ng-init="booleanValue1 = booleans[0]" 
												ng-model="booleanValue1" 
												ng-options="x for x in booleans">
												<option value="" disabled selected>t/f</option>
											</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
											
											<p style="margin:15px" ng-show="( ( (tempModule.MODULEID==55 || tempModule.MODULEID==57) && newdef_op_kind1_ch=='create')||tempModule.MODULEID==61 || tempModule.MODULEID==63)">
											attribute：<input type="text"  style="width:100px" ng-model="attribute1_ch" > <input type="text"  style="width:100px" ng-model="attribute2_ch" >
													   <input type="text"  style="width:100px" ng-model="attribute3_ch" > <input type="text"  style="width:100px" ng-model="attribute4_ch" >
													   <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													   <input type="text"  style="width:100px" ng-model="attribute5_ch" > <input type="text"  style="width:100px" ng-model="attribute6_ch" >
													   <input type="text"  style="width:100px" ng-model="attribute7_ch" > <input type="text"  style="width:100px" ng-model="attribute8_ch" ></p>
													   
											<p ng-show=" tempModule.MODULEID==55 && newdef_op_kind1_ch=='alter'"><b>column :</b></p>
											<p style="margin:15px" ng-show="(tempModule.MODULEID==55 ) && newdef_op_kind1_ch=='alter'">
											Name:<input type="text"  style="width:150px" ng-model="columnName1_ch" > Type:<input type="text"  style="width:150px" ng-model="columnType1_ch" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize1_ch" ></p>
											<p style="margin:15px" ng-show=" (tempModule.MODULEID==55 ) && newdef_op_kind1_ch=='alter'">
											Name:<input type="text"  style="width:150px" ng-model="columnName2_ch" > Type:<input type="text"  style="width:150px" ng-model="columnType2_ch" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize2_ch" ></p>
											<p style="margin:15px" ng-show=" (tempModule.MODULEID==55 ) && newdef_op_kind1_ch=='alter'">
											Name:<input type="text"  style="width:150px" ng-model="columnName3_ch" > Type:<input type="text"  style="width:150px" ng-model="columnType3_ch" >
											Size:<input type="text"  style="width:80px" ng-model="columnSize3_ch" ></p>
											
											<p style="margin:15px" ng-show=" tempModule.MODULEID==56">
											index:<input type="text"  style="width:200px" ng-model="index1_ch" >
											<input type="text"  style="width:200px" ng-model="index2_ch" >
											<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="text"  style="width:200px" ng-model="index3_ch" >
											<input type="text"  style="width:200px" ng-model="index4_ch" >
											</p>
											<p ng-show="(tempModule.MODULEID==56 || tempModule.MODULEID==57) && newdef_op_kind1=='alter'"><b>暂不支持定义此类题目！</b></p>
											<p ng-init="addattr1=1" style="margin:15px" ng-show="tempModule.MODULEID==61">
											key：<input type="text"  style="width:100px" ng-model="key1" > <input type="text"  style="width:100px" ng-model="key2" >
													   <input type="text"  style="width:100px" ng-model="key3" > <input type="text"  style="width:100px" ng-model="key4" ></p>
											
											<p ng-init="addattr1=1" style="margin:15px" ng-show="tempModule.MODULEID==63">
											exportedkey：<input type="text"  style="width:100px" ng-model="exportedKey1" > <input type="text"  style="width:100px" ng-model="exportedKey2" >
													   <input type="text"  style="width:100px" ng-model="exportedKey3" > <input type="text"  style="width:100px" ng-model="exportedKey4" >
													   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
											</div>
											
							</div>
							
							<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal" onclick="CloseDiv('MyDiv1','fade1')">取消</button>

							<button type="button" class="btn btn-primary" id='submitexam1'
								ng-click="expchangeon(x2.QUESTIONID)">确定</button>
							</div>
						
						</div>
						<!-- end -->
						
						<!-- 输入框########################################### -->
						<div id="fade" class="black_overlay"></div>
						<div id="MyDiv3" class="white_content">

							<div style="text-align: right; cursor: default; height: 40px;">
								<span style="font-size: 20px; margin: 5px"
									onclick="CloseDiv('MyDiv3','fade')"> <i
									class="icon-remove"></i></span>
							</div>
							<div
								style="background-color: #ffffff; margin: 20px auto 0; width: 90%"
								class="tab-content">
								<ul class="nav nav-pills nav-stacked" id="questions">
								</ul>
							</div>
							<div>
								<br>
								<label ng-model="x2">&nbsp;&nbsp;&nbsp;&nbsp;<strong>请输入SQL语句:</strong></label>
								<textarea rows="1" cols="2"
												style="width: 500px;height: 60px; float: center; margin-left: 0%"
												ng-model="test_sql1">{{test_sql1}}</textarea>
								<br>
								<br>
							</div>
							
							<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal" onclick="CloseDiv('MyDiv3','fade2')">取消</button>

							<button type="button" class="btn btn-primary" id='submitexam1'
								ng-click="test_sqlinput()">确定</button>
							</div>
						
						</div>
						<!-- end -->
					
	</div>
	</section>
	<!--main content end-->
	</section>
	</section>
	</div>

	<script type="text/javascript" src="/rucdbcourse/views/js/jquery.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/js/echarts.min.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/lib/angular.min.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/js/loading-bar.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/js/jquery.easing.min.js"></script>
	<!-- js placed at the end of the document so the pages load faster -->

	<script src="/rucdbcourse/views/js/jquery.dataTables.js"></script>
	<script src="/rucdbcourse/views/js/dataTables.bootstrap.js"></script>
	<script src="/rucdbcourse/views/js/bootstrap.min.js"></script>
	<script src="/rucdbcourse/views/js/jquery.scrollTo.min.js"></script>
	<script src="/rucdbcourse/views/js/jquery.nicescroll.js"
		type="text/javascript"></script>
	<script src="/rucdbcourse/views/js/jquery-ui-1.9.2.custom.min.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/assets/layer/layer.js"></script>
	<!--custom switch-->
	<script src="/rucdbcourse/views/js/bootstrap-switch.js"></script>
	<!--custom tagsinput-->
	<script src="/rucdbcourse/views/js/jquery.tagsinput.js"></script>
	<!--custom checkbox & radio-->
	<script type="text/javascript" src="/rucdbcourse/views/js/ga.js"></script>
	<!--common script for all pages-->
	<script src="/rucdbcourse/views/js/common-scripts.js"></script>
	<script src="/rucdbcourse/views/js/sidebar.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/js/num2Chinese.js"></script>
	<script type="text/javascript"
		src="/rucdbcourse/views/js/jquery.table2excel.min.js"></script>
	<script src="/rucdbcourse/views/assets/layer/layer.js"></script>
	<script src="http://thecodeplayer.com/uploads/js/jquery-1.9.1.min.js"
		type="text/javascript"></script>
	<script src="http://thecodeplayer.com/uploads/js/jquery.easing.min.js"
		type="text/javascript"></script>
	<script src="js/zzsc.js" type="text/javascript"></script>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<div style="text-align: center; clear: both">
		<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
		<script src="/follow.js" type="text/javascript"></script>
	</div>

	<!--script for this page-->
	<script type="text/javascript">
		/*     document.ready(function(){
		 $(".nav-pills>li").mouseover(function(){
		 $(".nav-pills>li").css("background-color","yellow");
		 });
		 }); */
	</script>
	<!--验证码-->
	<script>
		var app = angular.module('index', [ 'chieffancypants.loadingBar' ])
				.config(function(cfpLoadingBarProvider) {
					cfpLoadingBarProvider.includeSpinner = true;
				});
		app
				.controller(
						'indexCtrl',
						function($scope, $http, $timeout, cfpLoadingBar) {
							 var vm = $scope.vm = {};
							 //
							cfpLoadingBar.start();
							$scope.fakeIntro = true;
							$timeout(function() {
								cfpLoadingBar.complete();
								$scope.fakeIntro = false;
							}, 750);
							//判断有没有登陆过
							$http({
								method : 'GET',
								url : '../user/getSession'
							}).then(function(response) {
								// debugger
								// console.log(response)
								if (response.data.value == 'nlogin') {
									window.location = "/rucdbcourse/";
								} else {
									$scope.userName = response.data.value
								}
							}, function(error) {
								console.log(error)
							});

							$http({
								method : 'GET',
								url : '../module/getModules'
							}).then(function(response) {
								$scope.modules = response.data;
								$scope.modules2 = response.data;
							}, function(error) {
								console.log(error)
							});

							$scope.right = 1;
							$http({
								method : 'GET',
								url : '../user/getUsersByAno'
							}).then(function(response) {
								//debugger
								// console.log(response)
								$scope.studentLists = response.data;
								$("#sidebar .active").removeClass("active");
								$("#check").addClass("active");
							}, function(error) {
								console.log(error)
							});

							$scope.analyse = function() {
								$scope.right = 3;
								$("#sidebar .active").removeClass("active");
								$("#analyse").addClass("active");

								$http({
									url : '/rucdbcourse/tracker/timeAnalyse',
									method : 'GET',
								}).then(function(response) {
									var data = response.data;
									for (var i = 0; i < data.length; i++) {
										//xdata.push('第' + new change((i + 1).toString()).pri_ary() + '题');
										//scores.push(studentScoreEntities[i].SCORE)
									}
								}, function(error) {
									console.log(error)
								});

								var analyse1 = echarts.init(document
										.getElementById('analyse1'));
								option = {
									title : {
										text : '模块完成时间分析',
									},
									tooltip : {
										trigger : 'axis',
										axisPointer : {
											type : 'cross'
										}
									},
									toolbox : {
										show : true,
										feature : {
											saveAsImage : {}
										}
									},
									xAxis : {
										type : 'category',
										boundaryGap : false,
										axisLabel : {
											interval : 0,//横轴信息全部显示  
											rotate : -30,//-30度角倾斜显示  
										},
										data : [ '单表查询', '多表查询', '数据更新',
												'表的定义/修改与删除', '索引的建立与删除',
												'视图的建立与删除', '实体完整性', '参照完整性',
												'授权与回收', '触发器设置', '存储过程' ]
									},
									yAxis : {
										type : 'value',
										axisLabel : {
											formatter : '{value} 分钟'
										},
										axisPointer : {
											snap : true
										}
									},
									visualMap : {
										show : false,
										dimension : 0,
										pieces : [ {
											lte : 6,
											color : 'green'
										}, {
											gt : 6,
											lte : 8,
											color : 'red'
										}, {
											gt : 8,
											lte : 14,
											color : 'green'
										}, {
											gt : 14,
											lte : 17,
											color : 'red'
										}, {
											gt : 17,
											color : 'green'
										} ]
									},
									series : [
											{
												name : '赵展浩',
												type : 'line',
												smooth : true,
												data : [ 30, 28, 25, 26, 27,
														30, 35, 20, 40, 60, 40,
														10 ],
											},
											{
												name : '程一舰',
												type : 'line',
												smooth : true,
												data : [ 33, 21, 3, 4, 10, 26,
														8, 11, 17, 26, 18, 24 ],
											},
											{
												name : '丁鹏傑',
												type : 'line',
												smooth : true,
												data : [ 50, 18, 2, 4, 0, 0,
														15, 0, 0, 0, 0, 0 ],
											}, ]
								};
								analyse1.setOption(option);

							};

							$scope.check = function() {
								$scope.right = 1;
								$("#sidebar .active").removeClass("active");
								$("#check").addClass("active");
							};
							//新增删除功能
							$scope.deluser = function(student) {
								//alert(student.NAME+student.USERID);
								$http({
									method : 'GET',
									url : '../user/deleteUser',
									params : {
										userId : student.USERID
									}
								}).then(function(response) {
									//student.STATUS = 1
									alert("删除成功");
									$http({
										method : 'GET',
										url : '../user/getUsersByAno'
									}).then(function(response) {
										//debugger
										// console.log(response)
										$scope.studentLists = response.data;
										$("#sidebar .active").removeClass("active");
										$("#check").addClass("active");
									}, function(error) {
										console.log(error)
									});
									//
								}, function(error) {
									console.log(error)
								});
							};
							$scope.pass = function(student) {
								// alert("hello");
								$http({
									method : 'GET',
									url : '../user/updateUsersStatus',
									params : {
										userId : student.USERID,
										status : 1
									}
								}).then(function(response) {
									// debugger
									student.STATUS = 1
									// console.log(response)
								}, function(error) {
									console.log(error)
								});
							};

							$scope.reject = function(student) {
								$http({
									method : 'GET',
									url : '../user/updateUsersStatus',
									params : {
										userId : student.USERID,
										status : 3
									}
								}).then(function(response) {
									// debugger
									student.STATUS = 3
									// console.log(response)
								}, function(error) {
									console.log(error)
								});
							};

							$("#excel").click(function() {
								$("#scores").table2excel({
									exclude : ".noExl",
									name : "sheet1",
									filename : "成绩单.xls",
									fileext : ".xls",
									exclude_img : true,
									exclude_links : true,
									exclude_inputs : true
								});
								//$("#scores").tableExport({type:'excel',escape:'false'});
							});

							
							//点击模块展示学生成绩
							$scope.moduleClick = function(module) {
								$("#sidebar .active").removeClass("active");
								var flag = $("." + module.MODULEID).parent()
										.attr("class");
								if (flag == "sub") {
									$("." + module.MODULEID).parent().parent()
											.addClass("active");
								}
								$("." + module.MODULEID).addClass("active");

								$scope.right = 2;
								// console.log('----' + module.MODULEID + '----');
								//拼装echarts所需要的数据
								$scope.tempModule = module //全局可用的当前选择的module
								//--------------饼图-------------------
								var totalStudents = 0;
								var totalStuArr;
								var submittedStudents = 0;
								var submittedStuArr;
								var savedStudents = 0;
								var savedStuArr;
								var notdoStudents = 0;
								var notdoStuArr;
								//1.获取该教师所负责的总人数 
								$http({
									method : 'GET',
									url : '../echart/getRealUsersByAno',
									params : {
										moduleId : module.MODULEID
									}
								})
										.then(
												function(response) {
													totalStuArr = response.data;
													totalStudents = response.data.length;
													//2.获取已经提交/已经做题的人
													$http(
															{
																method : 'GET',
																url : '../echart/haveSubmitedByAnoAndModule',
																params : {
																	moduleId : module.MODULEID
																}
															})
															.then(
																	function(
																			response) {
																		submittedStuArr = response.data;
																		submittedStudents = response.data.length;
																		//3.获取保存的人/正在进行的  总-已经-正在=未做  
																		$http(
																				{
																					method : 'GET',
																					url : '../echart/haveSavedByAnoAndModule',
																					params : {
																						moduleId : module.MODULEID
																					}
																				})
																				.then(
																						function(
																								response) {
																							savedStuArr = response.data;
																							savedStudents = response.data.length
																							//获取保存的人/正在进行的  总-已经-正在=未做 
																							notdoStudents = totalStudents
																									- (submittedStudents + savedStudents)
																							//将获得的数据进行echart所需数据结构的构建
																							// 基于准备好的dom，初始化echarts实例
																							var pieEchart = echarts
																									.init(document
																											.getElementById('pieEchart'));
																							option = {
																								title : {
																									text : module.NAME,
																									subtext : '人数统计',
																									x : 'center'
																								},
																								tooltip : {
																									trigger : 'item',
																									formatter : "{a} <br/>{b} : {c} ({d}%)"
																								},
																								legend : {
																									orient : 'vertical',
																									left : 'left',
																									data : [
																											'已作答',
																											'正在进行',
																											'未作答' ]
																								},
																								series : [ {
																									name : module.NAME,
																									type : 'pie',
																									radius : '55%',
																									center : [
																											'50%',
																											'60%' ],
																									data : [
																											{
																												value : submittedStudents,
																												name : '已作答'
																											},
																											{
																												value : savedStudents,
																												name : '正在进行'
																											},
																											{
																												value : notdoStudents,
																												name : '未作答'
																											} ],
																									itemStyle : {
																										emphasis : {
																											shadowBlur : 10,
																											shadowOffsetX : 0,
																											shadowColor : 'rgba(0, 0, 0, 0.5)'
																										}
																									}
																								} ]
																							};
																							pieEchart
																									.setOption(option);
																							pieEchart
																									.on(
																											'click',
																											function(
																													params) {
																												var flag = params.dataIndex;
																												var showStr = "";
																												if (flag == 0) {//已答
																													for (var i = 0; i < submittedStuArr.length; i++) {
																														var temp = submittedStuArr[i].USERID;
																														for (var j = 0; j < totalStuArr.length; j++) {
																															if (temp == totalStuArr[j].USERID) {
																																if (showStr == "") {
																																	showStr = totalStuArr[j].REALNAME;
																																} else {
																																	showStr = showStr
																																			+ ","
																																			+ totalStuArr[j].REALNAME;
																																}
																															}
																														}
																													}
																												} else if (flag == 1) {
																													for (var i = 0; i < savedStuArr.length; i++) {
																														var temp = savedStuArr[i].USERID;
																														for (var j = 0; j < totalStuArr.length; j++) {
																															if (temp == totalStuArr[j].USERID) {
																																if (showStr == "") {
																																	showStr = totalStuArr[j].REALNAME;
																																} else {
																																	showStr = showStr
																																			+ ","
																																			+ totalStuArr[j].REALNAME;
																																}
																															}
																														}
																													}
																												} else if (flag == 2) {
																													var notdoStu = [];
																													for (var i = 0; i < totalStuArr.length; i++) {
																														var point = 0;
																														var temp = totalStuArr[i].USERID;
																														for (var j = 0; j < submittedStuArr.length; j++) {
																															if (temp == submittedStuArr[j].USERID) {
																																point = 1;
																															}
																														}
																														for (var j = 0; j < savedStuArr.length; j++) {
																															if (temp == savedStuArr[j].USERID) {
																																point = 1;
																															}
																														}
																														if (point == 0) {
																															if (showStr == "") {
																																showStr = totalStuArr[i].REALNAME;
																															} else {
																																showStr = showStr
																																		+ ","
																																		+ totalStuArr[i].REALNAME;
																															}
																														}
																													}
																												}
																												if (showStr == ""
																														|| showStr == null) {
																													showStr = "没有数据"
																												}
																												layer
																														.open({
																															skin : 'layui-layer-molv',
																															title : '学生名单',
																															content : showStr,
																															area : [
																																	'320px',
																																	'180px' ]
																														});
																											});
																							//-------------------------------饼图结束-------------------------------
																						},
																						function(
																								error) {
																							console
																									.log(error)
																						}); //http 3 end 

																	},
																	function(
																			error) {
																		console
																				.log(error)
																	}); //http 2 end 
												}, function(error) {
													console.log(error)
												}); //http 1 end

								//-------------------------------按题目统计成绩柱状图-----------------------------------
								$http({
									method : 'GET',
									url : '../module/getModuleDetailsByteacher',
									params : {
										moduleId : module.MODULEID,
										//userId : $scope.student.USERID
									}
								}).then(function(response) {
													//
													$scope.expModules = response.data;
													//用来显示1 2 3的题目
													count = response.data.length;
													$scope.count = count;

													$http(
															{
																method : 'GET',
																url : '../echart/haveSubmitedAllByAnoAndModule',
																params : {
																	moduleId : module.MODULEID
																}
															})
															.then(
																	function(response) { //1.获取教师总学生
																		// console.log(response.data);
																		$scope.scores = response.data;

																		var data1 = []; //横坐标
																		var data0 = []; //0分
																		var name0 = [];
																		var data5 = []; //5分
																		var name5 = [];
																		var data10 = []; //10分
																		var name10 = [];
																		var nameSum=[];
																		var dataSum = []; //总人数

																		for (var i = 0; i < $scope.expModules.length; i++) {
																			$scope.expModules[i].num = new change((i + 1).toString()).pri_ary();
																			data1.push(''+ new change((i + 1).toString()).pri_ary()+ '');
																			data0.push(0);
																			name0.push("");
																			data5.push(0);
																			name5.push("");
																			data10.push(0);
																			name10.push("");
																			dataSum.push(0);
																			nameSum.push("");
																		}
																		;

																		for (var i = 0; i < $scope.scores.length; i++) {
																			var temp = $scope.scores[i];
																			//var index = temp.EXPID - 1;
																			var numt=parseInt($scope.scores.length/$scope.expModules.length);
																			var index=parseInt(i/numt)%$scope.expModules.length;
																			if (temp.SCORE == "10.0") {
																				data10[index] = data10[index] + 1;
																				if (name10[index] == "") {
																					name10[index] = temp.REALNAME;
																				} else {
																					name10[index] = name10[index]+ ","+ temp.REALNAME;
																				}
																				if(nameSum[index] == "")nameSum[index] = temp.REALNAME;
																				else nameSum[index] = nameSum[index]+ ","+ temp.REALNAME;

																			} else if (temp.SCORE == "5.0") {
																				data5[index] = data5[index] + 1;
																				if (name5[index] == "") {
																					name5[index] = temp.REALNAME;
																				} else {
																					name5[index] = name5[index]+ ","+ temp.REALNAME;
																					nameSum[index] = nameSum[index]+ ","+ temp.REALNAME;
																				}
																				if(nameSum[index] == "")nameSum[index] = temp.REALNAME;
																				else nameSum[index] = nameSum[index]+ ","+ temp.REALNAME;
																			} else if (temp.SCORE == "0.0") {
																				data0[index] = data0[index] + 1;
																				if (name0[index] == "") {
																					name0[index] = temp.REALNAME;
																				} else {
																					name0[index] = name0[index]+ ","+ temp.REALNAME;
																				}
																				if(nameSum[index] == "")nameSum[index] = temp.REALNAME;
																				else nameSum[index] = nameSum[index]+ ","+ temp.REALNAME;

																			}else{
																				if(nameSum[index] == "")nameSum[index] = temp.REALNAME;
																				else nameSum[index] = nameSum[index]+ ","+ temp.REALNAME;
																			}
																			dataSum[index] += 1;
																		}

																		var barEchart = echarts.init(document.getElementById('barEchart'));
																		option = {
																			title : {
																				//text: module.NAME,
																				text : '成绩统计',
																			},
																			tooltip : {
																				trigger : 'axis',
																				axisPointer : {
																					type : 'cross',
																					crossStyle : {
																						color : '#999'
																					}
																				}
																			},
																			toolbox : {
																				feature : {
																					dataView : {
																						show : true,
																						readOnly : false
																					},
																					magicType : {
																						show : true,
																						type : [
																								'line',
																								'bar' ]
																					},
																					restore : {
																						show : true
																					},
																					saveAsImage : {
																						show : true
																					}
																				}
																			},
																			legend : {
																				data : [
																						'0分',
																						'5分',
																						'10分',
																						'总人数' ]
																			},
																			xAxis : [ {
																				type : 'category',
																				data : data1,
																				axisPointer : {
																					type : 'shadow'
																				}
																			} ],
																			yAxis : [
																					{
																						type : 'value',
																						name : '人数',

																						maxInterval : 10000,
																						axisLabel : {
																							formatter : '{value} 人'
																						}
																					}, ],
																			series : [
																					{
																						name : '0分',
																						type : 'bar',
																						data : data0
																					},
																					{
																						name : '5分',
																						type : 'bar',
																						data : data5
																					},
																					{
																						name : '10分',
																						type : 'bar',
																						data : data10
																					},
																					{
																						name : '总人数',
																						type : 'line',
																						data : dataSum

																					}, ]
																		};
																		barEchart.setOption(option);
																		barEchart.on('click',function(params) {
																							// console.log(params.seriesIndex);
																							// console.log(params.dataIndex)
																							var showStr;
																							if (params.seriesIndex == 0) {
																								showStr = name0[params.dataIndex]
																							} else if (params.seriesIndex == 1) {
																								showStr = name5[params.dataIndex]
																							} else if (params.seriesIndex == 2) {
																								showStr = name10[params.dataIndex]
																							}else{
																								showStr =nameSum[params.dataIndex]                                       
																							}
																							if (showStr == ""
																									|| showStr == null) {
																								showStr == "没有数据"
																							}
																							layer.open({
																										skin : 'layui-layer-molv',
																										title : '学生名单',
																										content : showStr,
																										area : [
																												'320px',
																												'180px' ]
																									});
																						});
																	},
																	function(
																			error) {
																		console
																				.log(error)
																	});
												}, function(error) {
													console.log(error)
												}); //http 3 end 

								//-------------------------个人成绩折线图-----------------
								$http({
									method : 'GET',
									url : '../echart/getRealUsersByAno'
								}).then(function(response) { //1.获取教师总学生
									// console.log(response)
									$scope.userLists = response.data;
								}, function(error) {
									console.log(error)
								});

								//-------------------------成绩单---------------
								$http(
										{
											url : '/rucdbcourse/echart/getScoreByModuleAndAno',
											method : 'GET',
											params : {
												moduleId : module.MODULEID
											}
										}).then(function(response) {
									$scope.scoresList = response.data;
								}, function(error) {
									console.log(error)
								});
								//场景
								$http({
									url : '/rucdbcourse/exam/getExpscene',
									method : 'GET',
								}).then(function(response){
									$scope.expscene=response.data;
									$scope.chosescene=$scope.expscene[0];
									$scope.chosescene1=$scope.expscene[0];
									//alert($scope.expscene[0].SNAME);
								}, function(error) {
									console.log(error)
								});
								//-------------------------试卷管理---------------
							after_paper_on = function(){
								$http({
									url : '/rucdbcourse/exam/getPapers',
									method : 'GET',
									params : {
										moduleId : $scope.tempModule.MODULEID
									}
								})
										.then(
												function(response) {

													//$scope.scoresList = response.data;
													$("#ExamTable tbody tr")
															.remove();
													for (var i = 0; i < response.data.length; i++) {
														var industry = response.data[i];
														if (industry.ISACTIVE == 1) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					+ "</td> <td><span style='color:green'>已启用</span></td> <td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
														} else if (industry.ISACTIVE == 0) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					+ "</td> <td><button onclick="
																					//+ "\"Paper_on('"+industry.PAPERID+"')\""
																					+ "\"Paper_on('"+industry.PAPERID+"','"+industry.PMODULEID+"')\""
																					+ ")' class='btn btn-primary btn-sm'>启用</button></td> <td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
														} else if (industry.ISACTIVE == -1) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					+ "</td> <td><span style='color:red'>已结束</span></td><td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
														}
														/* <tr><td>111</td><td>{{ExamContent}}</td>
														<td ng-show="exam.STATUS == 0">
														    <button ng-click="pass(exam)" class="btn btn-primary btn-sm">启用</button>
														    <button ng-click="reject(exam)" class="btn btn-default btn-sm">禁用</button>
														</td>
														<td ng-show="exam.STATUS == 1">
														    <span style="color:green">已启用</span>
														</td>
														<td ng-show="exam.STATUS == 3">
														    <span style="color:red">已禁用</span>
														</td>
														</tr> */
													}
												}, function(error) {
													console.log(error)
												})
								};
								
								Paper_on = function(paperId,pmoduleId){//需要修改
									$http(
											{
												url : '../exam/startPaper',
												method: 'GET',
												params : {
														paperId : paperId,
														moduleId : pmoduleId
												}
											}
										).success(function(response) {
											after_paper_on();
											layer.msg("启用试卷成功！");
											
									});
									};
								Paper_del = function(paperId){
										$http(
												{
													url : '../exam/deletePaper',
													method: 'GET',
													params : {
															paperId : paperId
													}
												}
											).success(function(response) {
											after_paper_on();
											layer.msg("试卷删除成功！");
												
										});
										};
								
								
								$http({
									url : '/rucdbcourse/exam/getPapers',
									method : 'GET',
									params : {
										moduleId : module.MODULEID
									}
								})
										.then(
												function(response) {

													//$scope.scoresList = response.data;
													$("#ExamTable tbody tr")
															.remove();
													/* for (var ...){
														var industry =..
														if(){
															
															
														}
													} */
													for (var i = 0; i < response.data.length; i++) {
														var industry = response.data[i];
														if (industry.ISACTIVE == 1) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					+ "</td> <td><span style='color:green'>已启用</span></td><td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
														} else if (industry.ISACTIVE == 0) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					//+ "</td> <td><button ng-click='Paper_on("
																					//+ industry.PAPERID
																					//+ ")' class='btn btn-primary btn-sm'>启用</button></td></tr>");
															
																					+ "</td> <td><button onclick="
																					//+ "\"Paper_on('"+industry.PAPERID+"')\""
																					+ "\"Paper_on('"+industry.PAPERID+"','"+industry.PMODULEID+"')\""
																					+ " class='btn btn-primary btn-sm'>启用</button></td><td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ " class='btn btn-primary btn-sm'>删除</button></td></tr>");
								
														} else if (industry.ISACTIVE == -1) {
															$(
																	"#ExamTable tbody")
																	.append(
																			"<tr><td>"
																					+ (i + 1)
																					+ "</td><td>"
																					+ industry.PNAME
																					+ "</td> <td><span style='color:red'>已结束</span></td><td><button onclick="
																					+ "\"Paper_del('"+industry.PAPERID+"')\""
																					+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
														}
														/* <tr><td>111</td><td>{{ExamContent}}</td>
														<td ng-show="exam.STATUS == 0">
														    <button ng-click="pass(exam)" class="btn btn-primary btn-sm">启用</button>
														    <button ng-click="reject(exam)" class="btn btn-default btn-sm">禁用</button>
														</td>
														<td ng-show="exam.STATUS == 1">
														    <span style="color:green">已启用</span>
														</td>
														<td ng-show="exam.STATUS == 3">
														    <span style="color:red">已禁用</span>
														</td>
														</tr> */
													}
												}, function(error) {
													console.log(error)
												})
												/* .then(
														function(response){
															layer.msg("new");
															
														
														}
														
										
												) */;
								
								//展示已定义题目模块
								//gyh note 
								$http({
									method : 'GET',
									//change!
									url : '../exam/getExplistByTeacher',
									params : {
										moduleId : $scope.tempModule.MODULEID,
									},
									headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
								}).then(function(response) {
									console.log("cccccccccccccccccccccccccccc");
									console.log(response);
									//$scope.explist = response.data;
								
								////分页
								
								//数据源
								$scope.data = response.data;
								//分页总数
								$scope.pageSize = 7;
								$scope.pages = Math.ceil($scope.data.length / $scope.pageSize); //分页数
								$scope.newPages = $scope.pages > 5 ? 5 : $scope.pages;
								$scope.pageList = [];
								$scope.selPage = 1;
								//设置表格数据源(分页)
								$scope.setData = function () {
								$scope.explist = $scope.data.slice(($scope.pageSize * ($scope.selPage - 1)), ($scope.selPage * $scope.pageSize));//通过当前页数筛选出表格当前显示数据
								}
								$scope.explist = $scope.data.slice(0, $scope.pageSize);
								//分页要repeat的数组
								for (var i = 0; i < $scope.newPages; i++) {
								$scope.pageList.push(i + 1);
								}
								
								//打印当前选中页索引
								$scope.selectPage = function (page) {
								//不能小于1大于最大
								if (page < 1 || page > $scope.pages) return;
								//最多显示分页数5
								if (page > 2) {
								//因为只显示5个页数，大于2页开始分页转换
								var newpageList = [];
								for (var i = (page - 3) ; i < ((page + 2) > $scope.pages ? $scope.pages : (page + 2)) ; i++) {
								newpageList.push(i + 1);
								}
								$scope.pageList = newpageList;
								}
								$scope.selPage = page;
								$scope.setData();
								$scope.isActivePage(page);
								console.log("选择的页：" + page);
								};
								//设置当前选中页样式
								$scope.isActivePage = function (page) {
								return $scope.selPage == page;
								};
								//上一页
								$scope.Previous = function () {
								$scope.selectPage($scope.selPage - 1);
								};
								//下一页
								$scope.Next = function () {
								$scope.selectPage($scope.selPage + 1);
								};
								
								}, function(error) {
									console.log(error)
								});
								
								//删除题目
								$scope.expdel = function(questionid,moduleid) {
								$http({
									method : 'GET',
									url : '../exam/delExpByTeacher',
									params : {
										questionId : questionid,
										moduleId : moduleid,
									},
									headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
								}).then(function(response) {
									alert("删除成功");
									//删除自定义题目后重新显示
									$http({
										method : 'GET',
										url : '../exam/getExplistByTeacher',
										params : {
											moduleId : $scope.tempModule.MODULEID,
										},
										headers:{
													'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
												},
									}).then(function(response) {
										console.log(response);
									////分页
									//数据源
									$scope.data = response.data;
									//分页总数
									$scope.pageSize = 7;
									$scope.pages = Math.ceil($scope.data.length / $scope.pageSize); //分页数
									$scope.newPages = $scope.pages > 5 ? 5 : $scope.pages;
									$scope.pageList = [];
									$scope.selPage = 1;
									//设置表格数据源(分页)
									$scope.setData = function () {
									$scope.explist = $scope.data.slice(($scope.pageSize * ($scope.selPage - 1)), ($scope.selPage * $scope.pageSize));//通过当前页数筛选出表格当前显示数据
									}
									$scope.explist = $scope.data.slice(0, $scope.pageSize);
									//分页要repeat的数组
									for (var i = 0; i < $scope.newPages; i++) {
									$scope.pageList.push(i + 1);
									}
									//打印当前选中页索引
									$scope.selectPage = function (page) {
									//不能小于1大于最大
									if (page < 1 || page > $scope.pages) return;
									//最多显示分页数5
									if (page > 2) {
									//因为只显示5个页数，大于2页开始分页转换
									var newpageList = [];
									for (var i = (page - 3) ; i < ((page + 2) > $scope.pages ? $scope.pages : (page + 2)) ; i++) {
									newpageList.push(i + 1);
									}
									$scope.pageList = newpageList;
									}
									$scope.selPage = page;
									$scope.setData();
									$scope.isActivePage(page);
									console.log("选择的页：" + page);
									};
									//设置当前选中页样式
									$scope.isActivePage = function (page) {
									return $scope.selPage == page;
									};
									//上一页
									$scope.Previous = function () {
									$scope.selectPage($scope.selPage - 1);
									};
									//下一页
									$scope.Next = function () {
									$scope.selectPage($scope.selPage + 1);
									};
									
									}, function(error) {
										console.log(error)
									});
									
								}, function(error) {
									alert("删除失败，请重新删除!!");
									console.log(error);
								});
								}
								//end
								//ng-click查看题目信息
								$scope.expchange = function(questionid,moduleid) {
								ShowDiv('MyDiv1', 'fade1');
      							$http({
									method : 'GET',
									url : '../exam/getExpByTeacher',
									params : {
										questionId : questionid,
										moduleId : moduleid,
									},
									headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
								}).then(function(response) {
									$scope.expcho=response.data;
									$scope.x2=$scope.expcho[0];
									$scope.xedesc=$scope.x2.EDESC;
									$scope.xsolution=$scope.x2.SOLUTION;
									$scope.xextra=$scope.x2.EXTRA;
									$scope.x3=JSON.parse($scope.expcho[0].EXTRA);
									if($scope.x2.MODULEID==51 || $scope.x2.MODULEID==52 || $scope.x2.MODULEID==62){
									//alert("test:"+$scope.x3.sql[0].sql);
									//$scope.x4=JSON.parse($scope.x3.sql[0]);
									$scope.x4=$scope.x3.sql[0];
									//$scope.x4=$scope.expcho[0].EXTRA;
									$scope.testq1=$scope.x3.sql[0].sql;
									$scope.testq2=$scope.x3.sql[1].sql;
									$scope.testq3=$scope.x3.sql[2].sql;
									$scope.testv1=$scope.x3.sql[0].value;
									$scope.testv2=$scope.x3.sql[1].value;
									$scope.testv3=$scope.x3.sql[2].value;
									$scope.changebooleanValue=$scope.x3.rule;
									$scope.changedef_op_kind=$scope.x3.type;
									}
									if($scope.x2.MODULEID==55){
										$scope.newdef_op_kind1_ch=$scope.x3.type;
									}
									if($scope.x2.MODULEID==55 || $scope.x2.MODULEID==56 ){
										$scope.tablename_ch=$scope.x3.tableName;
									}
									if($scope.x2.MODULEID==57){
										$scope.viewname_ch=$scope.x3.viewName;
									}
									if(($scope.tempModule.MODULEID==55 || $scope.tempModule.MODULEID==57) && $scope.newdef_op_kind1_ch=='create'){
										$scope.attribute1_ch=$scope.x3.attribute[0];
										$scope.attribute2_ch=$scope.x3.attribute[1];
										$scope.attribute3_ch=$scope.x3.attribute[2];
										$scope.attribute4_ch=$scope.x3.attribute[3];
										$scope.attribute5_ch=$scope.x3.attribute[4];
										$scope.attribute6_ch=$scope.x3.attribute[5];
										$scope.attribute7_ch=$scope.x3.attribute[6];
										$scope.attribute8_ch=$scope.x3.attribute[7];
									}
									if($scope.x2.MODULEID==56){
										$scope.index1_ch=$scope.x3.index[0];
										$scope.index2_ch=$scope.x3.index[1];
										$scope.index3_ch=$scope.x3.index[2];
										$scope.index4_ch=$scope.x3.index[3];
									}
									if($scope.x2.MODULEID==55 && $scope.newdef_op_kind1_ch=='alter'){
										$scope.columnName1_ch=$scope.x3.attribute[0].columnName;
										$scope.columnType1_ch=$scope.x3.attribute[0].columnType;
										$scope.columnSize1_ch=$scope.x3.attribute[0].columnSize;
										$scope.columnName2_ch=$scope.x3.attribute[1].columnName;
										$scope.columnType2_ch=$scope.x3.attribute[1].columnType;
										$scope.columnSize2_ch=$scope.x3.attribute[1].columnSize;
										$scope.columnName3_ch=$scope.x3.attribute[2].columnName;
										$scope.columnType3_ch=$scope.x3.attribute[2].columnType;
										$scope.columnSize3_ch=$scope.x3.attribute[2].columnSize;
									}
									//alert($scope.x3.type);
									//alert($scope.x3.tableName);
								}, function(error) {
									console.log(error);
								});
      							//alert(expid+moduleid);
  							    };
  							    //end
  							    
								//expchangeon修改信息
								$scope.operate_kinds = ['select_normal','select_order',
								'insert','delete','update'];
								$scope.operate_kinds2 = ['create','alter'];
  							 		$scope.expchangeon = function(questionid){
  							 			var jsontemp = {
  												"type":String($scope.changedef_op_kind),
  												"rule":String($scope.changebooleanValue),
  												"sql":[
  													{"sql":$scope.testq1,
  													"value":$scope.testv1
  													},
  													{"sql":$scope.testq2,
  													"value":$scope.testv2
  													},
  													{"sql":$scope.testq3,
  													"value":$scope.testv3
  													}
  												]
  												};
  							 			if(String($scope.testv1)!="undefined"){jsontemp.sql[0].value=parseInt($scope.testv1);}
  										if(String($scope.testv2)!="undefined"){jsontemp.sql[1].value=parseInt($scope.testv2);}
  										if(String($scope.testv3)!="undefined"){jsontemp.sql[2].value=parseInt($scope.testv3);}
  							 			$scope.jsonStr = JSON.stringify(jsontemp);
  							 			
									$http(
										{
											url:'../exam/changeExpByTeacher',
											method: 'POST',
											data : $
												.param({
													'edesc' : $scope.xedesc,
													'solution' :  $scope.xsolution,
													'type' : $scope.jsonStr,//&scope.change_op_kind,
													//'type' : $scope.testq1,
													'questionId': questionid
												}),
											headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										}
									
									).success(
									function(response){
										$http({
											method : 'GET',
											url : '../exam/getExplistByTeacher',
											params : {
											moduleId : $scope.tempModule.MODULEID,
													},
											headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
													},
								
											}).then(function(response) {
											$scope.data = response.data;
											}, function(error) {
											});
										alert("修改成功!");
										CloseDiv('MyDiv1', 'fade1');
										
									$scope.selectedq=null;
									$scope.newdef_edesc=null;
									$scope.newdef_answer=null;
									}
									);
								};
								
							
							
							    //click end
								//end
								
								/* //ng-click
								$scope.expchange = function(a) {
      							//$scope.myVar = !$scope.myVar;
      							alert("test");
      							//alert(a);
  							    }; */
								//pace
								//新增题目模块
								//1 定义场景数组(scenelist)
								//2 定义题目类型数组
								
								
								$scope.booleans = ['true','false'];
								$scope.befmoduleID=0;
								$scope.befexpID=0;
								//var value=parseInt($scope.newdef_more_value);
								//if(valuelength>0) {value="";}
								$scope.changetip=function(s){
									//alert(s);
									//alert(String(s));
								}
								$scope.test_null=function(){
									if($scope.tempModule.MODULEID!=55 && $scope.tempModule.MODULEID!=56 && $scope.tempModule.MODULEID!=57 && $scope.tempModule.MODULEID!=61 && $scope.tempModule.MODULEID!=63){
									if($scope.newdef_answer==null || $scope.newdef_answer=="")
										{alert("未输入答案，请返回填写！");}
									}
								}
								$scope.test_syntax=function(){
									$http({
										method : 'GET',
										url : '../module/checkSyntax',
										params : {
										answerSql : $scope.newdef_answer,
												},
										headers:{
											'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
												},
							
										}).then(function(response) {
										$scope.data = response.data;
										if($scope.newdef_answer=="" || $scope.newdef_answer==null) alert("未输入SQL语句");
										if($scope.data==true && $scope.newdef_answer!="") {
											//alert("SQL语句正确");
											layer.msg("SQL语句正确")
										}
										if($scope.data==false && $scope.newdef_answer!="") alert("SQL语句存在错误");
										}, function(error) {
										console.log(error)
										});
								}
								$scope.typeorrulechange =function(){
									$scope.addsql1=1;
									$scope.addattr1=1;
									$scope.addattr2=1;
								}
								$scope.add_sql = function(){	
									$scope.addsql1=$scope.addsql1+1;
								}
								$scope.sub_sql = function(){	
									if($scope.addsql1==2){
										$scope.newdef_more_sql2=null;
										$scope.newdef_more_value2=null;
										}
									if($scope.addsql1==3){
										$scope.newdef_more_sql3=null;
										$scope.newdef_more_value3=null;
										}
									$scope.addsql1=$scope.addsql1-1;
								}
								$scope.add_attr = function(){	
									$scope.addattr1=$scope.addattr1+1;
								}
								$scope.sub_attr = function(){	
									if($scope.addattr1==2){
										$scope.attribute5=null;
										$scope.attribute6=null;
										$scope.attribute7=null;
										$scope.attribute8=null;
									}
									$scope.addattr1=$scope.addattr1-1;
								}
								$scope.add_column = function(){	
									$scope.addattr2=$scope.addattr2+1;
								}
								$scope.sub_column = function(){	
									if($scope.addattr2==3){
										$scope.columnName3=null;
										$scope.columnSize3=null;
										$scope.columnType3=null;
									}
									if($scope.addattr2==2){
										$scope.columnName2=null;
										$scope.columnSize2=null;
										$scope.columnType2=null;
									}
									$scope.addattr2=$scope.addattr2-1;
								}
								$scope.test_edesc2 = function(){	
									//var valuestr=String($scope.newdef_more_value);
									//if(valuestr=="undefined"){valuestr=null;}
									//alert(valuestr+valuestr.length);
									//vm.newdef_more_sql1='newdef_more_sql1';
									//alert($scope.newdef_more_sql1);
									var jsontemp = {
									"type":String($scope.newdef_op_kind),
									"rule":String($scope.booleanValue),
									"sql":[
										{"sql":$scope.newdef_more_sql1,
										"value":$scope.newdef_more_value1
										},
										{"sql":$scope.newdef_more_sql2,
										"value":$scope.newdef_more_value2
										},
										{"sql":$scope.newdef_more_sql3,
										"value":$scope.newdef_more_value3
										}
									]
									};
									var jsontemp1={
										"type":String($scope.newdef_op_kind1),
										"tableName":$scope.tablename,
										"attribute":[$scope.attribute1]
									};
									if($scope.attribute2!="" && $scope.attribute2!=null)jsontemp1.attribute.push($scope.attribute2);
									if($scope.attribute3!="" && $scope.attribute3!=null)jsontemp1.attribute.push($scope.attribute3);
									if($scope.attribute4!="" && $scope.attribute4!=null)jsontemp1.attribute.push($scope.attribute4);
									if($scope.attribute5!="" && $scope.attribute5!=null)jsontemp1.attribute.push($scope.attribute5);
									if($scope.attribute6!="" && $scope.attribute6!=null)jsontemp1.attribute.push($scope.attribute6);
									if($scope.attribute7!="" && $scope.attribute7!=null)jsontemp1.attribute.push($scope.attribute7);
									if($scope.attribute8!="" && $scope.attribute8!=null)jsontemp1.attribute.push($scope.attribute8);
									
									var jsontemp2={
											"type":String($scope.newdef_op_kind1),
											"tableName":$scope.tablename,
											"attribute":[{
												"columnName":$scope.columnName1,
												"columnType":$scope.columnType1,
												"columnSize":parseInt($scope.columnSize1)
											}]
									};
									var json_attribute2={
										"columnName":$scope.columnName2,
										"columnType":$scope.columnType2,
										"columnSize":parseInt($scope.columnSize2)
									};
									var json_attribute3={
										"columnName":$scope.columnName3,
										"columnType":$scope.columnType3,
										"columnSize":parseInt($scope.columnSize3)
									};
									if($scope.columnName2!="" && $scope.columnName2!=null)jsontemp2.attribute.push(json_attribute2);
									if($scope.columnName3!="" && $scope.columnName3!=null)jsontemp2.attribute.push(json_attribute3);
									
									//视图的创建
									var jsontemp_view1={
										"type":String($scope.newdef_op_kind1),
										"viewName":$scope.viewname,
										"attribute":[$scope.attribute1]
									};
									if($scope.attribute2!="" && $scope.attribute2!=null)jsontemp_view1.attribute.push($scope.attribute2);
									if($scope.attribute3!="" && $scope.attribute3!=null)jsontemp_view1.attribute.push($scope.attribute3);
									if($scope.attribute4!="" && $scope.attribute4!=null)jsontemp_view1.attribute.push($scope.attribute4);
									if($scope.attribute5!="" && $scope.attribute5!=null)jsontemp_view1.attribute.push($scope.attribute5);
									if($scope.attribute6!="" && $scope.attribute6!=null)jsontemp_view1.attribute.push($scope.attribute6);
									if($scope.attribute7!="" && $scope.attribute7!=null)jsontemp_view1.attribute.push($scope.attribute7);
									if($scope.attribute8!="" && $scope.attribute8!=null)jsontemp_view1.attribute.push($scope.attribute8);
									//索引的创建
									var jsontemp_index1={
										"type":String($scope.newdef_op_kind1),
										"tableName":$scope.tablename,
										"index":[$scope.index1],
										"order":$scope.order
									};
									
									//实体完整性
									var jsontemp_integrity={
										"type":"entity_integrity",
										"tableName":$scope.tablename1,
										"attribute":[$scope.attribute1],
										"key":[$scope.key1],
										"exist":String($scope.booleanValue1)
									};
									if($scope.attribute2!="" && $scope.attribute2!=null)jsontemp_integrity.attribute.push($scope.attribute2);
									if($scope.attribute3!="" && $scope.attribute3!=null)jsontemp_integrity.attribute.push($scope.attribute3);
									if($scope.attribute4!="" && $scope.attribute4!=null)jsontemp_integrity.attribute.push($scope.attribute4);
									if($scope.attribute5!="" && $scope.attribute5!=null)jsontemp_integrity.attribute.push($scope.attribute5);
									if($scope.attribute6!="" && $scope.attribute6!=null)jsontemp_integrity.attribute.push($scope.attribute6);
									if($scope.attribute7!="" && $scope.attribute7!=null)jsontemp_integrity.attribute.push($scope.attribute7);
									if($scope.attribute8!="" && $scope.attribute8!=null)jsontemp_integrity.attribute.push($scope.attribute8);
									if($scope.key2!="" && $scope.key2!=null)jsontemp_integrity.key.push($scope.key2);
									if($scope.key3!="" && $scope.key3!=null)jsontemp_integrity.key.push($scope.key3);
									if($scope.key4!="" && $scope.key4!=null)jsontemp_integrity.key.push($scope.key4);
									
									if($scope.index2!="" && $scope.index2!=null)jsontemp_index1.index.push($scope.index2);
									if($scope.index3!="" && $scope.index3!=null)jsontemp_index1.index.push($scope.index3);
									if($scope.index4!="" && $scope.index4!=null)jsontemp_index1.index.push($scope.index4);
									//参照完整性
									var jsontemp_integrity2={
										"type":"entity_integrity",
										"tableName":$scope.tablename1,
										"attribute":[$scope.attribute1],
										"exportedKey":[$scope.exportedKey1],
										"exist":String($scope.booleanValue1)
									};
									if($scope.attribute2!="" && $scope.attribute2!=null)jsontemp_integrity2.attribute.push($scope.attribute2);
									if($scope.attribute3!="" && $scope.attribute3!=null)jsontemp_integrity2.attribute.push($scope.attribute3);
									if($scope.attribute4!="" && $scope.attribute4!=null)jsontemp_integrity2.attribute.push($scope.attribute4);
									if($scope.attribute5!="" && $scope.attribute5!=null)jsontemp_integrity2.attribute.push($scope.attribute5);
									if($scope.attribute6!="" && $scope.attribute6!=null)jsontemp_integrity2.attribute.push($scope.attribute6);
									if($scope.attribute7!="" && $scope.attribute7!=null)jsontemp_integrity2.attribute.push($scope.attribute7);
									if($scope.attribute8!="" && $scope.attribute8!=null)jsontemp_integrity2.attribute.push($scope.attribute8);
									if($scope.exportedKey2!="" && $scope.exportedKey2!=null)jsontemp_integrity2.exportedKey.push($scope.exportedKey2);
									if($scope.exportedKey3!="" && $scope.exportedKey3!=null)jsontemp_integrity2.exportedKey.push($scope.exportedKey3);
									if($scope.exportedKey4!="" && $scope.exportedKey4!=null)jsontemp_integrity2.exportedKey.push($scope.exportedKey4);
									
									if(String($scope.newdef_more_value1)!="undefined"){jsontemp.sql[0].value=parseInt($scope.newdef_more_value1);}
									if(String($scope.newdef_more_value2)!="undefined"){jsontemp.sql[1].value=parseInt($scope.newdef_more_value2);}
									if(String($scope.newdef_more_value3)!="undefined"){jsontemp.sql[2].value=parseInt($scope.newdef_more_value3);}
									$scope.jsonStr = JSON.stringify(jsontemp);
									if(String($scope.newdef_op_kind1)=="create" && $scope.tempModule.MODULEID==55){ $scope.jsonStr = JSON.stringify(jsontemp1);}
									if(String($scope.newdef_op_kind1)=="alter" && $scope.tempModule.MODULEID==55){ $scope.jsonStr = JSON.stringify(jsontemp2);}//table
									if(String($scope.newdef_op_kind1)=="create" && $scope.tempModule.MODULEID==57){ $scope.jsonStr = JSON.stringify(jsontemp_view1);}//view
									if(String($scope.newdef_op_kind1)=="create" && $scope.tempModule.MODULEID==56){ $scope.jsonStr = JSON.stringify(jsontemp_index1);}//index
									if($scope.tempModule.MODULEID==61){ $scope.jsonStr = JSON.stringify(jsontemp_integrity);}//integrity
									if($scope.tempModule.MODULEID==63){ $scope.jsonStr = JSON.stringify(jsontemp_integrity2);}//integrity
									$http(
										{
											url:'../exam/addExpByTeacher',
											method: 'POST',
											data : $
												.param({
													'moduleId' : $scope.tempModule.MODULEID,
													'edesc' : $scope.newdef_edesc,
													'solution' : $scope.newdef_answer,
													'jsonStr' : $scope.jsonStr,
													'befmoduleID':$scope.befmoduleID,
													'befexpID':$scope.befexpID,
													'sceneId' :$scope.chosescene1.SCENEID
												}),
											headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										}
									
									)
									.success(
									function(response){
										//$scope.newqst=$scope.newdef_edesc;
										//$scope.explist = response.data;
										///////////////////////////////////////////////////////////////
										$http({
											method : 'GET',
											url : '../exam/getExplistByTeacher',
											params : {
											moduleId : $scope.tempModule.MODULEID,
													},
											headers:{
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
													},
								
											}).then(function(response) {
											console.log("cccccccccccc");
											console.log(response);
											////分页
											
											//数据源
											$scope.data = response.data;
											
											//分页总数
											$scope.pageSize = 7;
											$scope.pages = Math.ceil($scope.data.length / $scope.pageSize); //分页数
											$scope.newPages = $scope.pages > 5 ? 5 : $scope.pages;
											$scope.pageList = [];
											$scope.selPage = 1;
											//设置表格数据源(分页)
											$scope.setData = function () {
											$scope.explist = $scope.data.slice(($scope.pageSize * ($scope.selPage - 1)), ($scope.selPage * $scope.pageSize));//通过当前页数筛选出表格当前显示数据
											}
											$scope.explist = $scope.data.slice(0, $scope.pageSize);
											//分页要repeat的数组
											for (var i = 0; i < $scope.newPages; i++) {
											$scope.pageList.push(i + 1);
											}
											
											//打印当前选中页索引
											$scope.selectPage = function (page) {
											//不能小于1大于最大
											if (page < 1 || page > $scope.pages) return;
											//最多显示分页数5
											if (page > 2) {
											//因为只显示5个页数，大于2页开始分页转换
											var newpageList = [];
											for (var i = (page - 3) ; i < ((page + 2) > $scope.pages ? $scope.pages : (page + 2)) ; i++) {
											newpageList.push(i + 1);
											}
											$scope.pageList = newpageList;
											}
											$scope.selPage = page;
											$scope.setData();
											$scope.isActivePage(page);
											console.log("选择的页：" + page);
											};
											//设置当前选中页样式
											$scope.isActivePage = function (page) {
											return $scope.selPage == page;
											};
											//上一页
											$scope.Previous = function () {
											$scope.selectPage($scope.selPage - 1);
											};
											//下一页
											$scope.Next = function () {
											$scope.selectPage($scope.selPage + 1);
											};
											
											alert("添加自定义题目成功!");
											$scope.newdef_edesc="";
											$scope.selectedq=null;
											$scope.newdef_edesc=null;
											$scope.newdef_answer=null;
											$scope.newdef_more_sql1=null;
											$scope.newdef_more_sql2=null;
											$scope.newdef_more_sql3=null;
											$scope.newdef_more_value1=null;
											$scope.newdef_more_value2=null;
											$scope.newdef_more_value3=null;
											$scope.addsql1=1;
											$scope.addattr1=1;
											$scope.addattr2=1;
											$scope.booleanValue=null;
											$scope.newdef_op_kind=null;$scope.newdef_op_kind1=null;
											$scope.tablename=null;
											$scope.tablename1=null;
											$scope.tablename2=null;
											$scope.viewname=null;
											$scope.attribute1=null;
											$scope.attribute2=null;
											$scope.attribute3=null;
											$scope.attribute4=null;
											$scope.attribute5=null;
											$scope.attribute6=null;
											$scope.attribute7=null;
											$scope.attribute8=null;
											$scope.columnName1=null;
											$scope.columnName2=null;
											$scope.columnName3=null;
											$scope.columnSize1=null;
											$scope.columnSize2=null;
											$scope.columnSize3=null;
											$scope.columnType1=null;
											$scope.columnType2=null;
											$scope.columnType3=null;
											$scope.index1=null;
											$scope.index2=null;
											$scope.index3=null;
											$scope.index4=null;
											$scope.order=null;
											$scope.key1=null;
											$scope.key2=null;
											$scope.key3=null;
											$scope.key4=null;
											$scope.exportedKey1=null;
											$scope.exportedKey2=null;
											$scope.exportedKey3=null;
											$scope.exportedKey4=null;
											$scope.booleanValue1=null;
											///###
										/////////////////////////////////////////////////
											}, function(error) {
											console.log(error)
											});
										/////////////////////////////////////////////////
										//alert(response.data)
									
									 $("#nedefine").hide();
									 $("#definehead").show();
									 //$("#firstdef").show();
									
									}
									);
								};
								
							}; //click end

							//学生改变
							$scope.studentChanged = function() {
								// console.log($scope.selectedStudent + "|" + $scope.moduleID + "|" + $scope.selectedStudent.USERID)
								$http(
										{
											method : 'GET',
											url : '../echart/getUserScoreByMoudleAndUserIdAndAno',
											params : {
												moduleId : $scope.tempModule.MODULEID,
												userId : $scope.selectedStudent.USERID
											}
										})
										.then(
												function(response) {
													console.log(response.data);
													var studentScoreEntities = response.data
													var xdata = [];
													var scores = [];
													for (var i = 0; i < studentScoreEntities.length; i++) {
														xdata
																.push('第'
																		+ new change(
																				(i + 1)
																						.toString())
																				.pri_ary()
																		+ '题');
														scores
																.push(studentScoreEntities[i].SCORE)
													}
													//--------------开始画折线图--------------
													var lineEchart = echarts
															.init(document
																	.getElementById('lineEchart'));
													option2 = {
														title : {
															text : "成绩-"
																	+ $scope.selectedStudent.REALNAME,
															subtext : $scope.tempModule.NAME,
															x : 'center'

														},
														tooltip : {
															trigger : 'axis',
															borderWidth : 1,
															borderColor : '#ccc',

														},
														legend : {
															data : [ '' ]
														},
														toolbox : {
															show : true,
															feature : {
																dataZoom : {
																	yAxisIndex : 'none'
																},
																dataView : {
																	readOnly : false
																},
																magicType : {
																	type : [
																			'line',
																			'bar' ]
																},
																restore : {},
																saveAsImage : {}
															}
														},
														xAxis : {
															type : 'category',
															boundaryGap : false,
															data : xdata
														},
														yAxis : {
															type : 'value',
															axisLabel : {
																formatter : '{value} 分'
															}
														},
														series : [ {
															name : '分数',
															type : 'line',
															data : scores
														} ]
													};
													lineEchart
															.setOption(option2);
													lineEchart
															.on(
																	'click',
																	function(
																			params) {
																		//layer.open('https://www.baidu.com/s?wd=' + encodeURIComponent(params.name));
																		// console.log(params.componentType);
																		// console.log(params.dataIndex)
																		layer
																				.open({
																					skin : 'layui-layer-molv',
																					title : '学生答案',
																					content : studentScoreEntities[params.dataIndex].SOLUTION,
																					area : [
																							'500px',
																							'200px' ]
																				});
																	});
												}, function(error) {
													console.log(error)
												});

								//做题用时折线图   timeEchart
								$http(
										{
											method : 'GET',
											url : '/rucdbcourse/tracker/getTimeByModule',
											params : {
												moduleId : $scope.tempModule.MODULEID,
												userId : $scope.selectedStudent.USERID
											}
										})
										.then(function(response) {
													console.log(response.data);
													var studentScoreEntities = response.data
													var xdata = [];
													var scores = [];
													for (var i = 0; i < studentScoreEntities.length; i++) {
														xdata.push('第'
																   + new change((i + 1).toString()).pri_ary()
																   + '题');
														//scores.push(studentScoreEntities[i].SCORE)
													}
													//--------------开始画折线图--------------
													var timeEchart = echarts.init(document.getElementById('timeEchart'));
													option3 = {
														title : {
															text : "用时-"
																	+ $scope.selectedStudent.REALNAME,
															subtext : $scope.tempModule.NAME,
															x : 'center'

														},
														tooltip : {
															trigger : 'axis',
															borderWidth : 1,
															borderColor : '#ccc',

														},
														legend : {
															data : [ '' ]
														},
														toolbox : {
															show : true,
															feature : {
																dataZoom : {
																	yAxisIndex : 'none'
																},
																dataView : {
																	readOnly : false
																},
																magicType : {
																	type : [
																			'line',
																			'bar' ]
																},
																restore : {},
																saveAsImage : {}
															}
														},
														xAxis : {
															type : 'category',
															boundaryGap : false,
															data : xdata
														},
														yAxis : {
															type : 'value',
															axisLabel : {
																formatter : '{value} 秒'
															}
														},
														series : [ {
															name : '时长',
															type : 'line',
															smooth : true,
															data : studentScoreEntities
														} ]
													};
													timeEchart.setOption(option3);
												}, function(error) {
													console.log(error)
												});

							};
							$scope.feedbackClick = function() {
								$scope.right = 100;

							};
							//////...................................
							$scope.activities = [ {
								id : 0,
								type : "全部类型",
								name : "全部类型"
							}, {
								id : 1,
								type : "数据操纵语言",
								name : "单表查询"
							}, {
								id : 2,
								type : "数据操纵语言",
								name : "多表查询"
							}, {
								id : 3,
								type : "数据操纵语言",
								name : "数据更新"
							}, {
								id : 4,
								type : "数据定义语言",
								name : "表的定义、修改与删除"
							}, {
								id : 5,
								type : "数据定义语言",
								name : "索引级建立与删除"
							}, {
								id : 6,
								type : "数据定义语言",
								name : "视图的建立与删除"
							}, {
								id : 7,
								type : "数据定义语言",
								name : "实体完整性"
							}, {
								id : 8,
								type : "数据定义语言",
								name : "参照完整性"
							}, {
								id : 9,
								type : "数据控制语言",
								name : "授权与回收"
							}, {
								id : 10,
								type : "数据库编程",
								name : "触发器设置"
							}, {
								id : 11,
								type : "数据库编程",
								name : "存储过程"
							}, {
								id : 12,
								type : "数据库恢复",
								name : "数据库恢复"
							}, ];
							$scope.replies = []
							$scope.feedbacktype = null;
							//显示留言

							$http({
								url : '../module/dealFeedback3',
								method : 'GET',

							}).success(function(response) {

								$scope.replies = response;

							}).error(function() {
								alert('读取失败.....');
							});

							//提交留言
							$scope.feedbacktext2=null;
							$scope.feedbackid = null;
							$scope.feedbacktext = [];
// 							$scope.feedbackSubmit = function(a, index) {
// 								console.log($scope.feedbacktext[index])
// 								console.log(a.ID)
// 								$http(
// 										{
// 											url : '../module/dealFeedback4',
// 											method : 'POST',
// 											data : $
// 													.param({
// 														'message' : $scope.feedbacktext[index],
// 														'id' : a.ID
// 													}),
// 											headers : {
// 												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
// 											},
// 										})
// 										.success(
// 												function(response) {
// 													layer.msg("提交成功！");

// 													$scope.replies[index].FEEDBACKANS = $scope.feedbacktext[index];
// 													$scope.feedbacktext[index] = "";
// 												},
// 												function(error) {
// 													console.log(error)
// 													layer.msg("提交失败", {
// 														icon : 0
// 													})
// 													$("button[name='submit']")
// 															.text('提交');
// 													$("button[name='submit']")
// 															.removeAttr(
// 																	'disabled');

// 												});

// 							};
							$scope.feedbackltSubmit = function() {
								console.log($scope.feedbacktext2)
								console.log($scope.feedbackLTid)
								if ($scope.feedbacktext2==null||$scope.feedbacktext2.replace(
										/(^s*)|(s*$)/g, "").length == 0) {
									layer.msg("回复不能为空！");
								} else {
									$http(
											{
												url : '../module/dealFeedbacklttea',
												method : 'POST',
												data : $
														.param({
															'message' : $scope.feedbacktext2,
															'id' : $scope.feedbackLTid
														}),
												headers : {
													'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
												},
											})
											.success(
													function(response) {
														layer.msg("回复成功！");
														$scope.feedbacktext2 = '';
														$scope.feedbacklts
																.push(response);
													},
													function(error) {
														console.log(error)
														layer.msg("提交失败", {
															icon : 0
														})
														$(
																"button[name='submit']")
																.text('提交');
														$(
																"button[name='submit']")
																.removeAttr(
																		'disabled');
													});
								}
							};
							$scope.feedbackLT = function(a, text, text2, type) {
								$scope.right = 200;
								$scope.feedbacklts = [];
								$scope.feedbackLTid = a;
								$scope.nowfeedback = text;
								$scope.nowfeedbacktext = text2;
								$scope.nowfeedbacktype = type;
								console.log($scope.feedbackLTid)
								console.log($scope.nowfeedback)
								console.log($scope.nowfeedbacktype)
								$http(
										{
											url : '../module/dealFeedbacklt',
											method : 'POST',
											data : $.param({
												'id' : a,

											}),
											headers : {
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										}).success(
										function(response) {
											$scope.feedbacklts = response;
										},
										function(error) {
											console.log(error)
											layer.msg("读取失败", {
												icon : 0
											})
											$("button[name='submit']").text(
													'提交');
											$("button[name='submit']")
													.removeAttr('disabled');
										});
							};
							$scope.test_input= function() {
								/*
								var name = prompt("请输入您的名字", ""); //将输入的内容赋给变量 name ，  
						        //这里需要注意的是，prompt有两个参数，前面是提示的话，后面是当对话框出来后，在对话框里的默认值  
						        if (name)//如果返回的有内容  
						        {  
						            alert("欢迎您" + name)  ;
						            $scope.newdef_edesc=name;
						        }  
								*/
								//ShowDiv('MyDiv3', 'fade2');
							}
							//获取到该行的答案 作为userSolution存储
							$scope.submit = function() {
								// console.log($scope.expModules)
								$http(
										{
											url : '../module/judgetUserModuleSolutions',
											method : 'POST',
											data : $
													.param({
														'message' : JSON
																.stringify($scope.expModules)
													}),
											headers : {
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										}).success(function(response) {
									alert(response.value + '分')
								});
							};
							//当场景改变时 题目随之变化
							$scope.sceneChanged = function() {
								$http(
										{
											url : '../exam/getExams',
											method : 'POST',
											params : {
												moduleId : $scope.tempModule.MODULEID
											},
											headers : {
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										}).then(
												function(response) {
													$("#questions li").remove();
													for (var i = 0; i < response.data.length; i++) {
														var industry = response.data[i];
														if(industry.SCENEID==$scope.chosescene.SCENEID && industry.ANO=="0000"){
														$("#questions").append(" <li value="+industry.QUESTIONID+"><label class='choice'> <input  type='checkbox' name='quest'  value="+industry.QUESTIONID+">  "
																				+ industry.EDESC
																				+ "</label><hr/></li>");
														}
													}
													$("#questions").append(" <li><label class='choice'> "
															+ "<font size='2' color='blue'>------------------------------------------------以下为自定义题目------------------------------------------------------</font>"
															+ "</label></li>");
													for (var i = 0; i < response.data.length; i++) {
														var industry = response.data[i];
														if(industry.SCENEID==$scope.chosescene.SCENEID && industry.ANO!="0000"){
														$("#questions").append(" <li value="+industry.QUESTIONID+"><label class='choice'> <input  type='checkbox' name='quest'  value="+industry.QUESTIONID+">  "
																				+ industry.EDESC
																				+ "</label><hr/></li>");
														}
													}
												});
							}
							//试卷管理模块
							$("#newexam").click(function() {

												ShowDiv('MyDiv', 'fade');
												$http(
														{
															url : '../exam/getExams',
															method : 'POST',
															params : {
																moduleId : $scope.tempModule.MODULEID
															},
															headers : {
																'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
															},
														})
														.then(
																function(response) {
																	$("#questions li").remove();
																	for (var i = 0; i < response.data.length; i++) {
																		var industry = response.data[i];
																		if(industry.SCENEID==$scope.chosescene.SCENEID && industry.ANO=="0000"){
																		$("#questions").append(" <li value="+industry.QUESTIONID+"><label class='choice'> <input  type='checkbox' name='quest'  value="+industry.QUESTIONID+">  "
																								+ industry.EDESC
																								+ "</label><hr/></li>");
																		}
																	}
																	$("#questions").append(" <li><label class='choice'> "
																			+ "<font size='2' color='blue'>------------------------------------------------以下为自定义题目------------------------------------------------------</font>"
																			+ "</label></li>");
																	for (var i = 0; i < response.data.length; i++) {
																		var industry = response.data[i];
																		if(industry.SCENEID==$scope.chosescene.SCENEID && industry.ANO!="0000"){
																		$("#questions").append(" <li value="+industry.QUESTIONID+"><label class='choice'> <input  type='checkbox' name='quest'  value="+industry.QUESTIONID+">  "
																								+ industry.EDESC
																								+ "</label><hr/></li>");
																		}
																	}
																});
											});
							$scope.navs=[]
							$("#newexam2")
							.click(
									function() {

										ShowDiv('MyDiv2', 'fade');
										$http(
												{
													url : '../exam/getExams',
													method : 'POST',
													params : {
														moduleId : $scope.tempModule.MODULEID
													},
													headers : {
														'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
													},
												})
												.then(
														function(
																response) {
															$scope.navs= response.data;
														});
									});
							$scope.selectedqId=0;
							$("#submitq").click( function(){
								CloseDiv('MyDiv2', 'fade');
								console.log($("input[name='quest2']:checked").val());
								$scope.selectedqId=$("input[name='quest2']:checked").val();
								
								$http(
										{
											url : '../exam/getSelected',
											method : 'POST',
											data : $.param({
												'id' : $scope.selectedqId,

											}),
											headers : {
												'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
											},
										})
										.then(
												function(
														response) {
													
													$scope.befmoduleID=response.data.MODULEID;
													$scope.befexpID=response.data.EXPID;
													$scope.selectedq=response.data.EDESC
													
												});
								
								
							})
							
							
							
							
							
							
							
							//提交新增试卷模块
							$("#submitexam")
									.click(function() {
												CloseDiv('MyDiv', 'fade');
												var questionArr = [];
												$("input[name='quest']:checkbox:checked")
														.each(function() {
																	questionArr.push($(this).val());
																});
				 										layer.prompt(
																{
																	title : '请输入试卷名称',
																	formType : 0
																},
																function(text,index) {
																	var qname = text;
																	layer.close(index);
																	//alert($scope.chosescene.SCENEID);
																	$http(
																			{
																				url : '../exam/getQuestions',
																				method : 'GET',
																				params : {
																					moduleId : $scope.tempModule.MODULEID,
																					qname : qname,
																					questionArr : questionArr,
																					sceneId : $scope.chosescene.SCENEID
																				},
																				headers : {
																					'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
																				},
																			})
																			.then(
																					function(response) {
																						layer.msg('已添加',
																										{
																											icon : 1
																										});
																						// 重新拼接试卷展示
																						$http(
																								{
																									url : '/rucdbcourse/exam/getPapers',
																									method : 'GET',
																									params : {
																										moduleId : $scope.tempModule.MODULEID
																									}
																								})
																								.then(
																										function(
																												response1) {
																											//$scope.scoresList = response.data;
																											$(
																													"#ExamTable tbody tr")
																													.remove();
																											for (var i = 0; i < response1.data.length; i++) {
																												var industry = response1.data[i];
																												if (industry.ISACTIVE == 1) {
																													$(
																															"#ExamTable tbody")
																															.append(
																																	"<tr><td>"
																																			+ (i + 1)
																																			+ "</td><td>"
																																			+ industry.PNAME
																																			+ "</td> <td><span style='color:green'>已启用</span></td><td><button onclick="
																																			+ "\"Paper_del('"+industry.PAPERID+"')\""
																																			+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
																												} else if (industry.ISACTIVE == 0) {
																													$(
																															"#ExamTable tbody")
																															.append(
																																	"<tr><td>"
																																			+ (i + 1)
																																			+ "</td><td>"
																																			+ industry.PNAME
																																			+ "</td> <td><button onclick="
																																			//+ "\"Paper_on('"+industry.PAPERID+"')\""
																																			+ "\"Paper_on('"+industry.PAPERID+"','"+industry.PMODULEID+"')\""
																																			+ ")' class='btn btn-primary btn-sm'>启用</button></td><td><button onclick="
																																			+ "\"Paper_del('"+industry.PAPERID+"')\""
																																			+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
																												} else if (industry.ISACTIVE == -1) {
																													$(
																															"#ExamTable tbody")
																															.append(
																																	"<tr><td>"
																																			+ (i + 1)
																																			+ "</td><td>"
																																			+ industry.PNAME
																																			+ "</td> <td><span style='color:red'>已结束</span></td><td><button onclick="
																																			+ "\"Paper_del('"+industry.PAPERID+"')\""
																																			+ "class='btn btn-primary btn-sm'>删除</button></td></tr>");
																												}
																											}
																										},
																										function(
																												error) {
																											console
																													.log(error)
																										});
																					});

																});
												//alert(questionArr);

											});

						});
		//自定义题目模块
		$("#subnewdef").click(function(){
			var current_fs, next_fs, previous_fs; //fieldsets
			var left, opacity, scale; //fieldset properties which we will animate
			var animating; //flag to prevent quick multi-click glitches
			var first_fs;
			 //$("#nedefine").hide();
			 current_fs = $(this).parent();
			 previous_fs = $(this).parent().prev();
			 //$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
				
				//show the next fieldset
				//previous_fs.show(); 
		});
		$("#definereturn").click(
		function(){
			 $("#nedefine").hide();
			 $("#definehead").show();
		}		
		
		)
		//		
		$("#newdefine").click(function() {
							 $("#nedefine").show();
							 $("#definehead").hide();
							ShowDiv('DefineDiv', 'definefade');
							$http(
									{
										url : '../exam/getExams',
										method : 'POST',
										params : {
											moduleId : $scope.tempModule.MODULEID
										},
										headers : {
											'Content-Type' : 'application/x-www-form-urlencoded;charset=utf-8'
										},
									})
									.then(
											function(response) {
												$("#questions li").remove();
												for (var i = 0; i < response.data.length; i++) {
													var industry = response.data[i];
													$("#questions")
															.append(
																	" <li value="+industry.QUESTIONID+"><label class='choice'> <input  type='checkbox' name='quest' value="+industry.QUESTIONID+">  "
																			+ industry.EDESC
																			+ "</label><hr/></li>");

												}
											});
						});
		
	</script>
	<script type="text/javascript">
		//弹出隐藏层
		function ShowDiv(show_div, bg_div) {
			document.getElementById(show_div).style.display = 'block';
			document.getElementById(bg_div).style.display = 'block';
			var bgdiv = document.getElementById(bg_div);
			bgdiv.style.width = document.body.scrollWidth;
			// bgdiv.style.height = $(document).height();
			$("#" + bg_div).height($(document).height());
		};
		//关闭弹出层
		function CloseDiv(show_div, bg_div) {
			document.getElementById(show_div).style.display = 'none';
			document.getElementById(bg_div).style.display = 'none';
		};
		//根据试卷id启用试卷
		function activePaper(paperid) {
			console.log(paperid);
			alert(paperid);
			$.ajax({
				url : '../exam/updateStatus',
				data : {
					paperid : paperid,
				},
				type : "post",
				error : function() {
					layer.msg('错误，请重试', {
						icon : 2
					});
				},
				success : function(data) {
					if (data == "1") {
						layer.msg('已启用', {
							icon : 1
						});
						//把按钮变成下架的
						//top.document.location.href = "/KungfuSchool_MS1_0/views/teacher/teacher.html";
					}
					if (data == "0") {
						layer.msg('错误，请重试', {
							icon : 2
						});
					}
				}
			});

		}
		
		$("#nedefine").hide();
		$("#definehead").show();
		
		function downloadFile(){
	        //var url='http://localhost:8080/rucdbcourse/download/test1.xlsx';
	        //window.open(url);
	        var url='/rucdbcourse/download/student-course.xlsx';
	        window.location.href=url;
	        //alert("download");
	    }
	</script>
</body>

</html>